feat(uniapp_v2): 二开功能迁移与小程序主包优化
- 从 uniapp 迁移 HJF 页面、API、组件及用户/订单相关改动 - queue、assets 使用独立分包以降低主包体积 - 修复首页单根节点与支付结果页 v-if 链 - 关闭 HjfDemoPanel 全局注册;uniNoticeBar 注释 $getAppWebview 避免 __webviewId__ 报错 - 配置域名与 manifest 应用名称;cache/store 防御性处理 Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,783 @@
|
||||
<template>
|
||||
<uni-popup :style="colorStyle" ref="popup" type="bottom" @change="popupChange">
|
||||
<view class="popup-content">
|
||||
<view class="header flex-center">
|
||||
<text class="title">已选礼物清单</text>
|
||||
<text class="close iconfont icon-ic_close1" @click="close"></text>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y class="gift-list">
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<view v-for="(item, index) in giftList" :key="index">
|
||||
<view class="flex-between-center gift-list-item">
|
||||
<!-- #ifndef MP -->
|
||||
<checkbox
|
||||
:value="item.id.toString()"
|
||||
:checked="item.checked"
|
||||
color="#ffffff"
|
||||
backgroundColor="#ffffff"
|
||||
activeBackgroundColor="var(--view-theme)"
|
||||
activeBorderColor="var(--view-theme)"
|
||||
:disabled="(!item.attrStatus || item.is_gift ? true : false) && footerswitch"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<checkbox :value="item.id" :checked="item.checked" :disabled="(!item.attrStatus || item.is_gift ? true : false) && footerswitch" />
|
||||
<!-- #endif -->
|
||||
<view class="flex-1 ml-22 flex">
|
||||
<view class="w-200 h-200 rd-16rpx">
|
||||
<image
|
||||
class="w-200 h-200 rd-16rpx"
|
||||
v-if="item.productInfo.attrInfo"
|
||||
:src="item.productInfo.attrInfo.image"
|
||||
@tap="goPage(1, '/pages/goods_details/index?id=' + item.productInfo.id)"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<image
|
||||
class="w-200 h-200 rd-16rpx"
|
||||
v-else
|
||||
:src="item.productInfo.image"
|
||||
@tap="goPage(1, '/pages/goods_details/index?id=' + item.productInfo.id)"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
</view>
|
||||
<view class="ml-20 flex-1 flex-col justify-between">
|
||||
<view class="w-full">
|
||||
<view class="w-382 line1 fs-28 fw-500 text--w111-333 lh-40rpx">{{ item.productInfo.store_name }}</view>
|
||||
<view
|
||||
class="inline-block max-w-322 h-38 lh-38rpx mt-12 bg--w111-f5f5f5 text--w111-999 rd-20rpx px-12 text-center fs-22"
|
||||
v-if="item.productInfo.attrInfo && item.productInfo.spec_type && !item.is_gift && item.attrStatus"
|
||||
@click.stop="cartAttr(item)"
|
||||
>
|
||||
<view class="flex">
|
||||
<text class="line1 max-w-260">{{ item.productInfo.attrInfo.suk }}</text>
|
||||
<text class="iconfont icon-ic_downarrow fs-24 ml-12"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inline-block max-w-322 h-38 lh-38rpx mt-12 bg--w111-f5f5f5 text--w111-999 rd-20rpx px-12 text-center fs-22" v-else>
|
||||
<view class="flex">
|
||||
<text class="line1">{{ item.productInfo.attrInfo.suk }}</text>
|
||||
<text class="iconfont icon-ic_downarrow fs-24 ml-12"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-end flex-wrap mt-12 w-382">
|
||||
<BaseTag
|
||||
:text="label.label_name"
|
||||
:color="label.color"
|
||||
:background="label.bg_color"
|
||||
:borderColor="label.border_color"
|
||||
:circle="label.border_color ? true : false"
|
||||
:imgSrc="label.icon"
|
||||
v-for="(label, idx) in item.productInfo.store_label"
|
||||
:key="idx"
|
||||
></BaseTag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between-center" :class="item.productInfo.store_label.length ? 'mt-12' : 'mt-50'" v-if="item.attrStatus && !item.is_gift">
|
||||
<view>
|
||||
<baseMoney :money="item.sum_price" symbolSize="24" integerSize="36" decimalSize="24" weight></baseMoney>
|
||||
</view>
|
||||
<view class="flex-y-center pr-24 text--w111-333">
|
||||
<view class="flex-center w-48 h-48" @click.stop="subCart(index)">
|
||||
<text
|
||||
class="iconfont icon-ic_Reduce fs-24"
|
||||
:class="{
|
||||
'disabled-btn': item.productInfo.min_qty && item.cart_num == item.productInfo.min_qty
|
||||
}"
|
||||
></text>
|
||||
</view>
|
||||
<input
|
||||
type="number"
|
||||
maxlength="3"
|
||||
class="w-72 h-36 rd-4rpx bg--w111-f5f5f5 flex-center text-center fs-24 text--w111-333 mx-8"
|
||||
@input="setValue($event, item)"
|
||||
v-model="item.cart_num"
|
||||
/>
|
||||
<view class="flex-center w-48 h-48" @click.stop="addCart(index, item)">
|
||||
<text class="iconfont icon-ic_increase fs-24"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between-center pr-24" v-if="!item.attrStatus">
|
||||
<text class="fs-24 lh-34rpx">请重新选择商品规格</text>
|
||||
<view class="w-96 h-48 rd-24rpx flex-center bg--w111-fff fs-24 font-num con_border" @click.stop="reElection(item)">重选</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
</scroll-view>
|
||||
<view class="all flex flex-between-center px-20 py-20">
|
||||
<view class="flex-y-center">
|
||||
<checkbox-group @change="checkboxAllChange">
|
||||
<checkbox
|
||||
value="all"
|
||||
:checked="!!isAllSelect"
|
||||
color="#ffffff"
|
||||
backgroundColor="#ffffff"
|
||||
activeBackgroundColor="var(--view-theme)"
|
||||
activeBorderColor="var(--view-theme)"
|
||||
/>
|
||||
<text class="fs-26 text--w111-333 lh-36rpx">全选</text>
|
||||
</checkbox-group>
|
||||
<text class="total-price">
|
||||
预估总价:
|
||||
<text class="price">¥{{ selectValue.length ? discountInfo.deduction.pay_price || 0 : 0 }}</text>
|
||||
</text>
|
||||
</view>
|
||||
<button class="del" @click="subDel">删除</button>
|
||||
</view>
|
||||
<view class="footer flex-between-center">
|
||||
<button class="submit-btn" @click="submit">立即送给TA</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 规格选择弹窗 -->
|
||||
<productWindow
|
||||
:attr="attrs"
|
||||
:isShow="1"
|
||||
:iSplus="1"
|
||||
:iScart="1"
|
||||
:showFooter="true"
|
||||
:storeInfo="storeInfo"
|
||||
:is_vip="is_vip"
|
||||
:type="2"
|
||||
:fangda="false"
|
||||
@myevent="onMyEvent"
|
||||
@ChangeAttr="ChangeAttr"
|
||||
@ChangeCartNum="ChangeCartNum"
|
||||
@attrVal="attrVal"
|
||||
@iptCartNum="iptCartNum"
|
||||
@goCat="reGoCat"
|
||||
id="product-window"
|
||||
></productWindow>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import productWindow from '@/components/productWindow/index.vue';
|
||||
import { cartCompute, cartDel, changeCartNum, getResetCart } from '@/api/order.js';
|
||||
import { getAttr } from '@/api/store.js';
|
||||
import { Debounce } from '@/utils/validate.js';
|
||||
import colors from '@/mixins/color';
|
||||
export default {
|
||||
components: {
|
||||
productWindow
|
||||
},
|
||||
props: {
|
||||
giftList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
showSpecPopup: false,
|
||||
currentProduct: null,
|
||||
currentIndex: -1,
|
||||
attrs: {
|
||||
cartAttr: false,
|
||||
productAttr: [],
|
||||
productSelect: {}
|
||||
},
|
||||
selectValue: [], //选中的数据
|
||||
discountInfo: {
|
||||
discount: false,
|
||||
deduction: {},
|
||||
coupon: {},
|
||||
svip_price: 0,
|
||||
svip_status: false
|
||||
},
|
||||
isAllSelect: true,
|
||||
productValue: [], //系统属性
|
||||
storeInfo: {},
|
||||
attrValue: '', //已选属性
|
||||
attrTxt: '请选择', //属性页面提示
|
||||
cartId: 0,
|
||||
product_id: 0,
|
||||
is_vip: 0, //是否是会员
|
||||
isFooter: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin']),
|
||||
totalPrice() {
|
||||
return this.giftList
|
||||
.reduce((total, item) => {
|
||||
return item.checked ? total + item.price * item.num : total;
|
||||
}, 0)
|
||||
.toFixed(2);
|
||||
},
|
||||
selectedCount() {
|
||||
return this.giftList.filter((item) => item.checked).length;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.$refs.popup.open();
|
||||
this.$nextTick((e) => {
|
||||
this.setAllSelectValue(1);
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close();
|
||||
this.setAllSelectValue(0);
|
||||
},
|
||||
inArray: function (search, array) {
|
||||
for (let i in array) {
|
||||
if (array[i] == search) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// 点击切换属性
|
||||
cartAttr(item) {
|
||||
this.isCart = 1;
|
||||
this.getGoodsDetails(item);
|
||||
},
|
||||
// 修改购物车
|
||||
reGoCat: function () {
|
||||
let that = this,
|
||||
productSelect = that.productValue[this.attrValue];
|
||||
//如果有属性,没有选择,提示用户选择
|
||||
if (that.attrs.productAttr.length && productSelect === undefined) {
|
||||
return that.$util.Tips({
|
||||
title: '产品库存不足,请选择其它'
|
||||
});
|
||||
}
|
||||
let q = {
|
||||
id: that.cartId,
|
||||
product_id: that.product_id,
|
||||
num: that.attrs.productSelect.cart_num,
|
||||
unique: that.attrs.productSelect !== undefined ? that.attrs.productSelect.unique : '',
|
||||
is_send_gift: 1
|
||||
};
|
||||
getResetCart(q)
|
||||
.then(function (res) {
|
||||
that.attrs.cartAttr = false;
|
||||
that.$util.Tips({
|
||||
title: '添加清单成功',
|
||||
success: () => {
|
||||
that.loadend = false;
|
||||
that.page = 1;
|
||||
that.giftList = [];
|
||||
that.getCartList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((res) => {
|
||||
return that.$util.Tips({
|
||||
title: res.msg
|
||||
});
|
||||
});
|
||||
},
|
||||
getCartList() {
|
||||
this.$emit('getCartList');
|
||||
},
|
||||
// 重选
|
||||
reElection: function (item) {
|
||||
this.isCart = 0;
|
||||
this.getGoodsDetails(item);
|
||||
},
|
||||
/**
|
||||
* 获取产品详情
|
||||
*
|
||||
*/
|
||||
getGoodsDetails: function (item) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
let that = this;
|
||||
that.cartId = item.id;
|
||||
that.product_id = item.product_id;
|
||||
getAttr(item.product_id, 0)
|
||||
.then((res) => {
|
||||
uni.hideLoading();
|
||||
that.attrs.cartAttr = true;
|
||||
let storeInfo = res.data.storeInfo;
|
||||
that.$set(that, 'storeInfo', storeInfo);
|
||||
that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
|
||||
that.$set(that.attrs, 'productAttr', res.data.productAttr);
|
||||
that.$set(that, 'productValue', res.data.productValue);
|
||||
that.DefaultSelect();
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
subCart: Debounce(function (index) {
|
||||
let that = this;
|
||||
let status = false;
|
||||
let item = that.giftList[index];
|
||||
// 开启起购的话做一下不让减少的限制
|
||||
if (item.productInfo.min_qty && item.cart_num == item.productInfo.min_qty) return;
|
||||
item.cart_num = Number(item.cart_num) - 1;
|
||||
if (item.cart_num < 1) status = true;
|
||||
if (item.cart_num <= 1) {
|
||||
item.cart_num = 1;
|
||||
item.numSub = true;
|
||||
} else {
|
||||
item.numSub = false;
|
||||
item.numAdd = false;
|
||||
}
|
||||
that.setCartNum(item.id, item.cart_num, (data) => {
|
||||
that.giftList[index] = item;
|
||||
that.loadend = false;
|
||||
this.switchSelect();
|
||||
});
|
||||
}),
|
||||
addCart: Debounce(function (index, obj) {
|
||||
let that = this;
|
||||
let item = that.giftList[index];
|
||||
if (obj.numAdd || (obj.productInfo.limit_num > 0 && obj.cart_num >= obj.productInfo.limit_num)) {
|
||||
item.cart_num = item.productInfo.limit_num;
|
||||
return this.$util.Tips({
|
||||
title: '购物车数量不能大于限购数量'
|
||||
});
|
||||
}
|
||||
|
||||
item.cart_num = Number(item.cart_num) + 1;
|
||||
let productInfo = item.productInfo;
|
||||
if (productInfo.hasOwnProperty('attrInfo') && item.cart_num >= item.productInfo.attrInfo.stock) {
|
||||
item.cart_num = item.productInfo.attrInfo.stock;
|
||||
item.numAdd = true;
|
||||
item.numSub = false;
|
||||
} else {
|
||||
item.numAdd = false;
|
||||
item.numSub = false;
|
||||
}
|
||||
that.setCartNum(item.id, item.cart_num, (data) => {
|
||||
this.switchSelect();
|
||||
that.loadend = false;
|
||||
});
|
||||
}),
|
||||
popupChange(e) {
|
||||
if (!e.show) {
|
||||
this.giftList = [];
|
||||
// this.selectValue = [];
|
||||
this.isAllSelect = true;
|
||||
}
|
||||
this.$emit('change', e);
|
||||
},
|
||||
checkboxChange(event) {
|
||||
let that = this;
|
||||
let value = event.detail.value;
|
||||
let valid = that.giftList;
|
||||
let arr1 = [];
|
||||
let arr2 = [];
|
||||
let arr3 = [];
|
||||
let len = 0;
|
||||
valid.forEach((item) => {
|
||||
len = len + 1;
|
||||
if (that.inArray(item.id, value)) {
|
||||
if (that.footerswitch) {
|
||||
if (item.attrStatus && !item.is_gift) {
|
||||
item.checked = true;
|
||||
arr1.push(item);
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
} else {
|
||||
item.checked = true;
|
||||
arr1.push(item);
|
||||
}
|
||||
} else {
|
||||
item.checked = false;
|
||||
arr2.push(item);
|
||||
}
|
||||
});
|
||||
if (that.footerswitch) {
|
||||
arr3 = arr2.filter((item) => !item.attrStatus || item.is_gift);
|
||||
}
|
||||
that.$set(that.giftList, 'valid', valid);
|
||||
that.isAllSelect = len === arr1.length + arr3.length;
|
||||
that.selectValue = value;
|
||||
that.switchSelect();
|
||||
},
|
||||
setCartNum(cartId, cartNum, successCallback) {
|
||||
let that = this;
|
||||
changeCartNum(cartId, cartNum).then((res) => {
|
||||
successCallback && successCallback(res.data);
|
||||
});
|
||||
},
|
||||
checkboxAllChange(event) {
|
||||
let value = event.detail.value;
|
||||
if (value.length > 0) {
|
||||
this.setAllSelectValue(1);
|
||||
} else {
|
||||
this.discountInfo.deduction.pay_price = 0
|
||||
this.setAllSelectValue(0);
|
||||
}
|
||||
},
|
||||
setAllSelectValue: function (status) {
|
||||
let that = this;
|
||||
let selectValue = [];
|
||||
let valid = that.giftList;
|
||||
if (valid.length > 0) {
|
||||
valid.forEach((item) => {
|
||||
if (status) {
|
||||
if (that.footerswitch) {
|
||||
if (item.attrStatus && !item.is_gift) {
|
||||
item.checked = true;
|
||||
selectValue.push(item.id);
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
} else {
|
||||
item.checked = true;
|
||||
selectValue.push(item.id);
|
||||
}
|
||||
that.isAllSelect = true;
|
||||
} else {
|
||||
item.checked = false;
|
||||
that.isAllSelect = false;
|
||||
}
|
||||
});
|
||||
that.$set(that, 'giftList', valid);
|
||||
that.selectValue = selectValue;
|
||||
that.switchSelect();
|
||||
}
|
||||
},
|
||||
switchSelect: function () {
|
||||
let that = this;
|
||||
let validList = that.giftList;
|
||||
let selectValue = that.selectValue;
|
||||
let selectCountPrice = 0.0;
|
||||
let cartId = [];
|
||||
if (selectValue.length < 1) {
|
||||
that.selectCountPrice = selectCountPrice;
|
||||
} else {
|
||||
for (let index in validList) {
|
||||
if (that.inArray(validList[index].id, selectValue)) {
|
||||
cartId.push(validList[index].id);
|
||||
selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index].cart_num, validList[index].truePrice));
|
||||
}
|
||||
}
|
||||
that.selectCountPrice = selectCountPrice;
|
||||
}
|
||||
let data = {
|
||||
cartId: cartId.join(','),
|
||||
is_send_gift: 1
|
||||
};
|
||||
if (cartId.length) {
|
||||
this.getCartCompute(data);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 默认选中属性
|
||||
*
|
||||
*/
|
||||
DefaultSelect: function () {
|
||||
let productAttr = this.attrs.productAttr;
|
||||
let value = [],
|
||||
stock = 0,
|
||||
attrValue = [];
|
||||
for (var key in this.productValue) {
|
||||
if (this.productValue[key].stock > 0) {
|
||||
value = this.attrs.productAttr.length ? key.split(',') : [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
//isCart 1切换属性 0为重选
|
||||
if (this.isCart) {
|
||||
//购物车默认打开时,随着选中的属性改变
|
||||
// let attrValue = [];
|
||||
this.giftList.forEach((item) => {
|
||||
if (item.id == this.cartId) {
|
||||
attrValue = item.productInfo.attrInfo.suk.split(',');
|
||||
}
|
||||
});
|
||||
let key = attrValue.join(',');
|
||||
stock = this.productValue[key].stock;
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
this.$set(productAttr[i], 'index', stock ? attrValue[i] : value[i]);
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
this.$set(productAttr[i], 'index', value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//sort();排序函数:数字-英文-汉字;
|
||||
let productSelect = this.productValue[this.isCart && stock ? attrValue.join(',') : value.join(',')];
|
||||
if (productSelect && productAttr.length) {
|
||||
this.$set(this.attrs.productSelect, 'store_name', this.storeInfo.store_name);
|
||||
this.$set(this.attrs.productSelect, 'image', productSelect.image);
|
||||
this.$set(this.attrs.productSelect, 'price', productSelect.price);
|
||||
this.$set(this.attrs.productSelect, 'stock', productSelect.stock);
|
||||
this.$set(this.attrs.productSelect, 'unique', productSelect.unique);
|
||||
this.$set(this.attrs.productSelect, 'cart_num', 1);
|
||||
this.$set(this, 'attrValue', value.join(','));
|
||||
this.$set(this.attrs.productSelect, 'vip_price', productSelect.vip_price);
|
||||
this.$set(this, 'attrTxt', '已选择');
|
||||
} else if (!productSelect && productAttr.length) {
|
||||
this.$set(this.attrs.productSelect, 'store_name', this.storeInfo.store_name);
|
||||
this.$set(this.attrs.productSelect, 'image', this.storeInfo.image);
|
||||
this.$set(this.attrs.productSelect, 'price', this.storeInfo.price);
|
||||
this.$set(this.attrs.productSelect, 'stock', 0);
|
||||
this.$set(this.attrs.productSelect, 'unique', '');
|
||||
this.$set(this.attrs.productSelect, 'cart_num', 0);
|
||||
this.$set(this.attrs.productSelect, 'vip_price', this.storeInfo.vip_price);
|
||||
this.$set(this, 'attrValue', '');
|
||||
this.$set(this, 'attrTxt', '请选择');
|
||||
} else if (!productSelect && !productAttr.length) {
|
||||
this.$set(this.attrs.productSelect, 'store_name', this.storeInfo.store_name);
|
||||
this.$set(this.attrs.productSelect, 'image', this.storeInfo.image);
|
||||
this.$set(this.attrs.productSelect, 'price', this.storeInfo.price);
|
||||
this.$set(this.attrs.productSelect, 'stock', this.storeInfo.stock);
|
||||
this.$set(this.attrs.productSelect, 'unique', this.storeInfo.unique || '');
|
||||
this.$set(this.attrs.productSelect, 'cart_num', 1);
|
||||
this.$set(this.attrs.productSelect, 'vip_price', this.storeInfo.vip_price);
|
||||
this.$set(this, 'attrValue', '');
|
||||
this.$set(this, 'attrTxt', '请选择');
|
||||
}
|
||||
},
|
||||
attrVal(val) {
|
||||
this.$set(this.attrs.productAttr[val.indexw], 'index', this.attrs.productAttr[val.indexw].attr_values[val.indexn]);
|
||||
},
|
||||
getCartCompute(cartId) {
|
||||
cartCompute(cartId)
|
||||
.then((res) => {
|
||||
this.discountInfo.coupon = res.data.coupon;
|
||||
this.discountInfo.deduction = res.data.deduction;
|
||||
this.discountInfo.svip_price = res.data.svip_price;
|
||||
this.discountInfo.svip_status = res.data.svip_status;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
changeNum(index, delta) {
|
||||
const item = this.giftList[index];
|
||||
const newNum = item.num + delta;
|
||||
if (newNum < 1) return;
|
||||
if (item.limit && newNum > item.limit) {
|
||||
return this.$util.Tips({
|
||||
title: `购买数量不能超过${item.limit}件`
|
||||
});
|
||||
}
|
||||
item.num = newNum;
|
||||
this.$emit('update:giftList', [...this.giftList]);
|
||||
},
|
||||
deleteItem(index) {
|
||||
this.giftList.splice(index, 1);
|
||||
this.$emit('update:giftList', [...this.giftList]);
|
||||
},
|
||||
changeSpec(item) {
|
||||
this.currentProduct = item;
|
||||
this.showSpecPopup = true;
|
||||
// 这里需要调用获取商品规格的接口
|
||||
// getAttr(item.id).then(res => {
|
||||
// this.attrs.productAttr = res.data.productAttr;
|
||||
// this.attrs.productSelect = res.data.productSelect;
|
||||
// });
|
||||
},
|
||||
closeSpecPopup() {
|
||||
this.showSpecPopup = false;
|
||||
},
|
||||
/**
|
||||
* 属性变动赋值
|
||||
*
|
||||
*/
|
||||
ChangeAttr(res) {
|
||||
let productSelect = this.productValue[res];
|
||||
if (productSelect && productSelect.stock > 0) {
|
||||
this.$set(this.attrs.productSelect, 'image', productSelect.image);
|
||||
this.$set(this.attrs.productSelect, 'price', productSelect.price);
|
||||
this.$set(this.attrs.productSelect, 'stock', productSelect.stock);
|
||||
this.$set(this.attrs.productSelect, 'unique', productSelect.unique);
|
||||
this.$set(this.attrs.productSelect, 'cart_num', 1);
|
||||
this.$set(this.attrs.productSelect, 'vip_price', productSelect.vip_price);
|
||||
this.$set(this, 'attrValue', res);
|
||||
this.$set(this, 'attrTxt', '已选择');
|
||||
} else {
|
||||
this.$set(this.attrs.productSelect, 'image', this.storeInfo.image);
|
||||
this.$set(this.attrs.productSelect, 'price', this.storeInfo.price);
|
||||
this.$set(this.attrs.productSelect, 'stock', 0);
|
||||
this.$set(this.attrs.productSelect, 'unique', '');
|
||||
this.$set(this.attrs.productSelect, 'cart_num', 0);
|
||||
this.$set(this.attrs.productSelect, 'vip_price', this.storeInfo.vip_price);
|
||||
this.$set(this, 'attrValue', '');
|
||||
this.$set(this, 'attrTxt', '请选择');
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
if (this.selectedCount === 0) {
|
||||
return this.$util.Tips({
|
||||
title: '请至少选择一件礼物'
|
||||
});
|
||||
}
|
||||
const selectedGifts = this.giftList.filter((item) => item.checked);
|
||||
this.$emit('submit', selectedGifts);
|
||||
this.close();
|
||||
},
|
||||
|
||||
// 添加删除方法
|
||||
subDel(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
if (selectValue.length > 0)
|
||||
cartDel(selectValue).then((res) => {
|
||||
that.loadend = false;
|
||||
that.page = 1;
|
||||
that.giftList = [];
|
||||
that.getCartList();
|
||||
that.selectValue = [];
|
||||
});
|
||||
else
|
||||
return that.$util.Tips({
|
||||
title: '请先选择商品'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup-content {
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
max-height: 80vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: relative;
|
||||
padding: 32rpx;
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 32rpx;
|
||||
font-size: 42rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.gift-list {
|
||||
overflow-y: scroll;
|
||||
max-height: 700rpx;
|
||||
.gift-list-item {
|
||||
padding: 28rpx 0rpx 28rpx 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.gift-item {
|
||||
padding: 32rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.gift-image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.gift-info {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
margin-top: 12rpx;
|
||||
color: var(--view-theme);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.spec {
|
||||
margin-top: 12rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.num-input {
|
||||
width: 80rpx;
|
||||
height: 50rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
margin: 0 12rpx;
|
||||
border: 1rpx solid #eee;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.delete {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
.all {
|
||||
padding: 20rpx 32rpx;
|
||||
.del {
|
||||
font-size: 24rpx;
|
||||
color: var(--view-theme);
|
||||
border: 1rpx solid var(--view-theme);
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
.total-price {
|
||||
padding-left: 20rpx;
|
||||
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
||||
.price {
|
||||
color: var(--view-theme);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
padding: 20rpx 32rpx;
|
||||
background: #fff;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
|
||||
.select-all {
|
||||
margin: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background: var(--view-theme);
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.disabled-btn {
|
||||
color: #dedede;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,578 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="product-window"
|
||||
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt?'join':'') + ' ' + (iScart?'joinCart':'')"
|
||||
>
|
||||
<view class="textpic acea-row" @touchmove.stop.prevent="moveHandle">
|
||||
<view class="pictrue" @click="showImg()">
|
||||
<image :src="attr.productSelect.image"></image>
|
||||
<view class="icon flex-center" v-if="fangda">
|
||||
<view class="iconfont icon-ic_enlarge"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pl-24 pt-24 flex-col">
|
||||
<view class="flex-y-center" v-if="attr.productSelect.integral">
|
||||
<image src="@/static/img/mall05.png" class="w-32 h-32"></image>
|
||||
<text class="lh-40rpx font-num fs-40 SemiBold pl-8">{{attr.productSelect.integral}}</text>
|
||||
<text class="fs-28 lh-40rpx px-8 text--w111-666">+</text>
|
||||
<baseMoney :money="attr.productSelect.price" symbolSize="28" integerSize="40" decimalSize="28" color="var(--view-theme)" weight></baseMoney>
|
||||
</view>
|
||||
<baseMoney
|
||||
:money="attr.productSelect.price"
|
||||
symbolSize="32"
|
||||
integerSize="48"
|
||||
decimalSize="32"
|
||||
incolor="var(--primary-theme-con)"
|
||||
weight v-else></baseMoney>
|
||||
<view class="inline-block h-48 lh-48rpx text-center rd-24rpx bg-color fs-24 text--w111-fff px-20 mt-16"
|
||||
v-if="type == 0">
|
||||
预估到手 <text class="fs-28 fw-600 pl-8">¥{{attr.productSelect.pay_price}}</text>
|
||||
</view>
|
||||
<view class="mt-12 fs-24 text--w111-999" v-if="type == 1 || type == 3">限量:{{ attr.productSelect.quota_show || 0 }}</view>
|
||||
<view class="mt-12 fs-24 text--w111-999" v-else>库存:{{ attr.productSelect.stock || attr.productSelect.product_stock || 0 }}</view>
|
||||
</view>
|
||||
<view class="iconfont icon-ic_close1" @click="closeAttr"></view>
|
||||
</view>
|
||||
<view class="mt-36">
|
||||
<scroll-view scroll-y="true" :style="'max-height: '+windowHeight+'rpx'" >
|
||||
<view class="productWinList">
|
||||
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
||||
<view v-show="item.is_pic == 0">
|
||||
<view class="fs-28 fw-500 px-32">{{ item.attr_name }}</view>
|
||||
<view class="listn acea-row row-middle">
|
||||
<view class="itemn" :class="item.index === itemn.attr ? 'active' : ''"
|
||||
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)"
|
||||
:key="indexn">
|
||||
{{ itemn.attr }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="item.is_pic == 1">
|
||||
<view class="flex-between-center">
|
||||
<view class="fs-28 fw-500 px-32">{{ item.attr_name }}</view>
|
||||
<view class="pr-32 fs-24 text--w111-666 flex-y-center" v-show="gridShow == 1" @tap="toggleGridAttr(0)">
|
||||
<text class="iconfont icon-a-ic_Imageandtextsorting fs-28"></text>
|
||||
<text class="pl-6">列表</text>
|
||||
</view>
|
||||
<view class="pr-32 fs-24 text--w111-666 flex-y-center" v-show="gridShow == 0" @tap="toggleGridAttr(1)">
|
||||
<text class="iconfont icon-a-ic_Picturearrangement fs-28"></text>
|
||||
<text class="pl-6">宫格</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pl-32 mt-32" v-show="gridShow == 1">
|
||||
<scroll-view scroll-x="true" class="white-nowrap vertical-middle w-686"
|
||||
show-scrollbar="false">
|
||||
<view class="inline-block mr-12"
|
||||
v-for="(itemn, indexn) in item.attr_value"
|
||||
:key="indexn"
|
||||
@click="tapAttr(indexw, indexn)">
|
||||
<view class="grid-item-box" :class="item.index === itemn.attr ? 'grid-active' : ''">
|
||||
<view class="w-full h-192 relative">
|
||||
<image class="w-full h-192 block" :src="itemn.pic" mode="aspectFill"></image>
|
||||
<view class="proview-icon flex-center" @tap.stop="proviewImg(itemn.pic)">
|
||||
<text class="iconfont icon-ic_enlarge fs-24 text--w111-fff"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-1 bg--w111-f5f5f5 tname flex-center fs-24">{{itemn.attr}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="listn acea-row row-middle" v-show="gridShow == 0">
|
||||
<view class="cell-itemn flex-between-center"
|
||||
:class="item.index === itemn.attr ? 'active' : ''"
|
||||
v-for="(itemn, indexn) in item.attr_value" :key="indexn"
|
||||
@click="tapAttr(indexw, indexn)">
|
||||
<image :src="itemn.pic" class="w-48 h-48 rd-50-p111-"></image>
|
||||
<text class="pl-8">{{ itemn.attr }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="cart px-30 flex-between-center mt-24" v-if="type != 'setMeal' && type !='points'">
|
||||
<view class="fs-28">数量</view>
|
||||
<view class="carnum flex-y-center">
|
||||
<template v-if="type == 0">
|
||||
<text class="font-num fs-22" v-if="storeInfo.min_qty && !storeInfo.is_limit">(商品{{storeInfo.min_qty}}{{storeInfo.unit_name}}起购)</text>
|
||||
<text class="font-num fs-22" v-else-if="!storeInfo.min_qty && storeInfo.is_limit && storeInfo.limit_num > 0">(商品限购{{storeInfo.limit_num}}{{storeInfo.unit_name}})</text>
|
||||
<text class="font-num fs-22" v-else-if="storeInfo.min_qty && storeInfo.is_limit && storeInfo.limit_num > 0">(商品起购{{storeInfo.min_qty}}{{storeInfo.unit_name}} 限购{{storeInfo.limit_num}}{{storeInfo.unit_name}})</text>
|
||||
</template>
|
||||
<view class="item reduce flex-center"
|
||||
:class="{'on': reduceDisabled}" @click="CartNumDes">
|
||||
<text class="iconfont icon-ic_Reduce fs-24"></text>
|
||||
</view>
|
||||
<view class='item num flex-y-center'>
|
||||
<input type="number" :disabled="isDisabled" v-model="attr.productSelect.cart_num"
|
||||
@input="bindCode(attr.productSelect.cart_num)" />
|
||||
</view>
|
||||
<view class="item plus flex-center"
|
||||
:class="{'on': addDisabled }"
|
||||
@click="CartNumAdd">
|
||||
<text class="iconfont icon-ic_increase fs-24"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-box flex flex-between-center mt-74">
|
||||
<view class="gifts-box" @click="getGiftList">
|
||||
<image class="img" src="/static/images/gifts-box.png" mode=""></image>
|
||||
<view class="num">
|
||||
{{ giftCount }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-right">
|
||||
<view class="joinBnt bg-add" @click="cartConfirm()">
|
||||
加入送礼清单
|
||||
</view>
|
||||
<view class="joinBnt bg-gray" v-if="attr.productSelect.stock <= 0">已售罄</view>
|
||||
<view class="joinBnt bg-color" v-else @click="cartConfirm('buy')">立即送给TA</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask z-25" @touchmove.stop.prevent="moveHandle" :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let windowHeight = (uni.getWindowInfo().windowHeight*(3/4)-238)*2;
|
||||
export default {
|
||||
|
||||
props: {
|
||||
attr: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
storeInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
limitNum: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
giftCount: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
isShow: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSbnt: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSplus: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iScart: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
is_vip: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
type: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
},
|
||||
fangda: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
isExtends:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showFooter:{
|
||||
type:Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
windowHeight:windowHeight,
|
||||
gridShow: 1,
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
reduceDisabled(){
|
||||
if(this.type == 0 && this.storeInfo && this.storeInfo.min_qty){
|
||||
return this.storeInfo.min_qty == this.attr.productSelect.cart_num
|
||||
}else{
|
||||
return this.attr.productSelect.cart_num <= 1
|
||||
}
|
||||
},
|
||||
addDisabled(){
|
||||
if(this.type == 0 && this.storeInfo && this.storeInfo.is_limit && this.storeInfo.limit_num){
|
||||
return this.storeInfo.limit_num == this.attr.productSelect.cart_num
|
||||
}else{
|
||||
return this.attr.productSelect.cart_num >= this.attr.productSelect.stock;
|
||||
}
|
||||
},
|
||||
isDisabled(){
|
||||
if(this.type ==0 && (this.storeInfo.min_qty || this.storeInfo.limit_num)){
|
||||
return true
|
||||
}else false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleGridAttr(type){
|
||||
this.gridShow = type;
|
||||
},
|
||||
goCat() {
|
||||
this.$emit('goCat');
|
||||
},
|
||||
getGiftList(){
|
||||
this.$emit('getGiftList');
|
||||
},
|
||||
bindCode(e) {
|
||||
this.$emit('iptCartNum', this.attr.productSelect.cart_num);
|
||||
},
|
||||
closeAttr() {
|
||||
this.$emit('myevent');
|
||||
},
|
||||
CartNumDes() {
|
||||
if(this.reduceDisabled) return
|
||||
this.$emit('ChangeCartNum', false, 'giftsAttr');
|
||||
},
|
||||
CartNumAdd() {
|
||||
if(this.addDisabled) return
|
||||
this.$emit('ChangeCartNum', true, 'giftsAttr');
|
||||
},
|
||||
tapAttr: function(indexw, indexn) {
|
||||
let that = this;
|
||||
that.$emit("attrVal", {
|
||||
indexw: indexw,
|
||||
indexn: indexn
|
||||
});
|
||||
this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attr_values[indexn]);
|
||||
let value = that
|
||||
.getCheckedValue()
|
||||
.join(",");
|
||||
that.$emit("ChangeAttr", value,'giftsAttr');
|
||||
|
||||
},
|
||||
moveHandle() {},
|
||||
//获取被选中属性;
|
||||
getCheckedValue: function() {
|
||||
let productAttr = this.attr.productAttr;
|
||||
let value = [];
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
||||
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
||||
value.push(productAttr[i].attr_values[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
showImg() {
|
||||
this.$emit('getImg');
|
||||
},
|
||||
cartConfirm(type){
|
||||
this.$emit('onConfirm', type);
|
||||
},
|
||||
proviewImg(img){
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: [img]
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.vip-money {
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.vipImg {
|
||||
width: 56rpx;
|
||||
height: 20rpx;
|
||||
margin-left: 6rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.product-window {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
z-index: 100;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: all 0.3s ease-in-out;
|
||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
||||
padding-bottom: env(safe-area-inset-bottom);///兼容 IOS>11.2/
|
||||
}
|
||||
|
||||
.product-window.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.product-window.join {
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.product-window.joinCart {
|
||||
padding-bottom: 30rpx;
|
||||
z-index: 4000;
|
||||
}
|
||||
|
||||
.product-window .textpic {
|
||||
padding: 0 32rpx;
|
||||
margin-top: 48rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
position: relative;
|
||||
.icon{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
border-radius: 4rpx;
|
||||
position: absolute;
|
||||
bottom: 8rpx;
|
||||
right: 8rpx;
|
||||
text-align: center;
|
||||
line-height: 23rpx;
|
||||
.iconfont{
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text {
|
||||
width: 410rpx;
|
||||
font-size: 32rpx;
|
||||
color: #202020;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money {
|
||||
font-size: 24rpx;
|
||||
margin-top: 40rpx;
|
||||
.icon{
|
||||
display: inline-block;
|
||||
font-size: 16rpx;
|
||||
font-weight: normal;
|
||||
background: #FF9500;
|
||||
color: #fff;
|
||||
border-radius: 18rpx;
|
||||
padding: 2rpx 6rpx;
|
||||
margin-left: 10rpx;
|
||||
.iconfont{
|
||||
font-size: 16rpx;
|
||||
margin-right: 4rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-window .textpic .icon-ic_close1 {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: -5rpx;
|
||||
font-size: 35rpx;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
.product-window .productWinList .item~.item {
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn {
|
||||
padding: 0 32rpx 0 16rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn {
|
||||
// height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
border: 1rpx solid #F2F2F2;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 28rpx;
|
||||
margin: 24rpx 0 0 16rpx;
|
||||
background-color: #F2F2F2;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .active {
|
||||
color: var(--view-theme) !important;
|
||||
background: var(--view-minorColorT) !important;
|
||||
border-color: var(--view-theme) !important;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn.limit {
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum view {
|
||||
width: 84rpx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
color: #282828;
|
||||
font-size: 45rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce {
|
||||
border-right: 0;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
line-height: 48rpx;
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #DEDEDE;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus {
|
||||
border-left: 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #dedede;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .num {
|
||||
background: rgba(242, 242, 242, 1);
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.product-window .joinBnt {
|
||||
font-size: 28rpx;
|
||||
width: 284rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
color: #fff;
|
||||
margin: 0 0 12rpx 16rpx;
|
||||
}
|
||||
.bottom-box{
|
||||
padding: 0 32rpx;
|
||||
.gifts-box{
|
||||
position: relative;
|
||||
.img{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.num{
|
||||
position: absolute;
|
||||
right: -10rpx;
|
||||
top: -10rpx;
|
||||
color: #fff;
|
||||
padding: 3rpx;
|
||||
font-size:22rpx;
|
||||
background-color: var(--view-theme);
|
||||
border-radius: 50%;
|
||||
min-width: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.product-window .joinBnt.on {
|
||||
background-color: #bbb;
|
||||
color: #fff;
|
||||
}
|
||||
.mt-74{
|
||||
margin-top: 74rpx;
|
||||
}
|
||||
.join_cart{
|
||||
background-color: var(--view-bntColor);
|
||||
}
|
||||
.bg-add{
|
||||
background-color: #FAAD14;
|
||||
}
|
||||
.bg-gray{
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
.z-25{
|
||||
z-index: 25;
|
||||
}
|
||||
.w-686{
|
||||
width: 686rpx;
|
||||
}
|
||||
.grid-item-box{
|
||||
width: 196rpx;
|
||||
border: 2rpx solid #F5F5F5;
|
||||
border-radius: 8rpx;
|
||||
image{
|
||||
border-radius: 8rpx 8rpx 0 0;
|
||||
}
|
||||
.tname{
|
||||
width: 196rpx;
|
||||
border-radius: 0 0 8rpx 8rpx ;
|
||||
padding: 4rpx 12rpx;
|
||||
height: 74rpx;
|
||||
display: -webkit-box; /* 旧版弹性盒子 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2; /* 显示两行 */
|
||||
-webkit-box-orient: vertical; /* 垂直方向排列 */
|
||||
word-break: break-all; /* 允许单词断行 */
|
||||
white-space: normal; /* 允许文字折行 */
|
||||
}
|
||||
}
|
||||
.grid-active{
|
||||
border: 2rpx solid var(--view-theme);
|
||||
.tname{
|
||||
color: var(--view-theme);
|
||||
background: var(--view-minorColorT);
|
||||
}
|
||||
}
|
||||
.cell-itemn{
|
||||
line-height: 56rpx;
|
||||
border: 1rpx solid #F2F2F2;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
padding: 0 20rpx 0 4rpx;
|
||||
border-radius: 30rpx;
|
||||
margin: 24rpx 0 0 16rpx;
|
||||
background-color: #F2F2F2;
|
||||
word-break: break-all;
|
||||
}
|
||||
.proview-icon{
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
right: 8rpx;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background: #DDDDDD;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,418 @@
|
||||
<script>
|
||||
import { setCouponReceive } from '@/api/api.js';
|
||||
import baseDrawer from '@/components/tui-drawer/tui-drawer.vue';
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
discountInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
coupon: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
computedPrice: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
productSelect:{
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ruleshow: false,
|
||||
showGift: false,
|
||||
giveProducts:[],
|
||||
giveCoupon: [],
|
||||
give_integral: 0
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
typeFilter(val) {
|
||||
let obj = {
|
||||
0: '通用券',
|
||||
1: '品类券',
|
||||
2: '商品券',
|
||||
3: '品牌券'
|
||||
};
|
||||
return obj[val];
|
||||
}
|
||||
},
|
||||
components: {
|
||||
baseDrawer
|
||||
},
|
||||
methods: {
|
||||
closeDrawer() {
|
||||
this.$emit('closeDrawer');
|
||||
},
|
||||
getCouponUser(item, index) {
|
||||
if (item.is_use) {
|
||||
this.$emit('closeDrawer');
|
||||
return;
|
||||
}
|
||||
setCouponReceive(item.id)
|
||||
.then((res) => {
|
||||
this.$emit('ChangCouponsUseState', index);
|
||||
this.$util.Tips({
|
||||
title: '领取成功'
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
toggleRule(index) {
|
||||
this.$emit('ruleToggle', index);
|
||||
},
|
||||
showGiftChange(){
|
||||
if(!this.showGift){
|
||||
this.discountInfo.discount.forEach(item=>{
|
||||
if(item.promotions_type == 4){
|
||||
this.giveProducts = item.giveProducts;
|
||||
this.giveCoupon = item.giveCoupon;
|
||||
this.give_integral = item.give_integral;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.showGift = !this.showGift;
|
||||
},
|
||||
promotionPage(item){
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/goods_list/index?promotions_type=${item.promotions_type}&promotions_id=${item.id}`
|
||||
})
|
||||
//promotions_type=2&promotions_id=11
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<view>
|
||||
<base-drawer mode="bottom" :visible="visible" background-color="transparent" mask maskClosable @close="closeDrawer">
|
||||
<view class="w-full gradient-box rd-t-40rpx pt-32 relative">
|
||||
<view class="text-center fs-32 text--w111-333 fw-500">优惠</view>
|
||||
<view class="close-icon flex-center" @tap='closeDrawer'>
|
||||
<text class="iconfont icon-ic_close fs-24 text--w111-999"></text>
|
||||
</view>
|
||||
<view class="mt-48 px-20">
|
||||
<scroll-view scroll-y="true" class="scroll-content">
|
||||
<view v-if="productSelect.price > productSelect.pay_price">
|
||||
<view class="flex-center">
|
||||
<view class="inline-block p-14 rd-16rpx bg-primary-light text-center">
|
||||
<view class="text-primary-con fs-32 lh-32rpx Regular fw-600">¥{{ productSelect.pay_price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con pt-6">预估到手</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="border_bg relative mt-20 flex-center">
|
||||
<view class="w-140 h-88 rd-16rpx bg-primary-light flex-col flex-center relative z-10">
|
||||
<view class="text-primary-con fs-32 lh-32rpx fw-600 Regular">¥{{ productSelect.price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con">售价</view>
|
||||
</view>
|
||||
<view class="reduce" v-if="computedPrice.deduction.first_order_price > 0"></view>
|
||||
<view class="w-140 h-88 rd-16rpx bg-primary-light flex-col flex-center relative z-10" v-if="computedPrice.deduction.first_order_price > 0">
|
||||
<view class="text-primary-con fs-32 lh-32rpx fw-600 Regular">¥{{ computedPrice.deduction.first_order_price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con">首单优惠</view>
|
||||
</view>
|
||||
<view class="reduce" v-if="computedPrice.deduction.vip_price > 0"></view>
|
||||
<view class="w-140 h-88 rd-16rpx bg-primary-light flex-col flex-center relative z-10" v-if="computedPrice.deduction.vip_price > 0">
|
||||
<view class="text-primary-con fs-32 lh-32rpx fw-600 Regular">¥{{ computedPrice.deduction.vip_price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con">会员优惠</view>
|
||||
</view>
|
||||
<view class="reduce" v-if="computedPrice.deduction.promotions_price > 0"></view>
|
||||
<view class="w-140 h-88 rd-16rpx bg-primary-light flex-col flex-center relative z-10" v-if="computedPrice.deduction.promotions_price > 0">
|
||||
<view class="text-primary-con fs-32 lh-32rpx fw-600 Regular">¥{{ computedPrice.deduction.promotions_price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con">活动优惠</view>
|
||||
</view>
|
||||
<view class="reduce" v-if="computedPrice.deduction.coupon_price > 0"></view>
|
||||
<view class="w-140 h-88 rd-16rpx bg-primary-light flex-col flex-center relative z-10" v-if="computedPrice.deduction.coupon_price > 0">
|
||||
<view class="text-primary-con fs-32 lh-32rpx fw-600 Regular">¥{{ computedPrice.deduction.coupon_price }}</view>
|
||||
<view class="fs-20 lh-28rpx text-primary-con">
|
||||
<text v-show="computedPrice.coupon.use_min_price == 0">无门槛券</text>
|
||||
<text v-show="computedPrice.coupon.use_min_price != 0 && computedPrice.coupon.coupon_type == 1">满{{ computedPrice.coupon.use_min_price }}减{{ computedPrice.coupon.coupon_price }}</text>
|
||||
<text v-show="computedPrice.coupon.use_min_price != 0 && computedPrice.coupon.coupon_type == 2">满{{ computedPrice.coupon.use_min_price }}享{{ computedPrice.coupon.coupon_price }}折</text>
|
||||
</view>
|
||||
<!--
|
||||
<text v-show="item.use_min_price == 0">无门槛券</text>
|
||||
<text v-show="item.use_min_price != 0 && item.coupon_type == 1">满{{ item.use_min_price }}减{{ item.coupon_price }}</text>
|
||||
<text v-show="item.use_min_price != 0 && item.coupon_type == 2">满{{ item.use_min_price }}享{{ item.coupon_price }}折</text>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="discountInfo.discount.length">
|
||||
<view class="text--w111-333 fs-24 mt-40 lh-34rpx">商品可参与以下优惠促销活动</view>
|
||||
<view class="bg--w111-fff rd-24rpx px-24 mt-24">
|
||||
<view class="py-28 card-cell" v-for="(item, index) in discountInfo.discount" :key="index">
|
||||
<view class="flex-between-center" v-show="item.promotions_type != 4"
|
||||
@tap="promotionPage(item)">
|
||||
<view class="flex">
|
||||
<view class="flex-y-center px-8 h-38 lh-36rpx rd-8rpx fs-18 con-border text-primary-con">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<view class="ml-14">
|
||||
<view class="fs-24 lh-34rpx w-512 line1">{{item.desc}}</view>
|
||||
<view class="fs-20 text--w111-999 pt-8" v-show="item.promotions_type == 1">活动时间:{{item.start_time}} - {{item.stop_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-ic_rightarrow fs-24 text--w111-999"></text>
|
||||
</view>
|
||||
<view class="flex-between-center" v-show="item.promotions_type == 4">
|
||||
<view class="flex flex-1">
|
||||
<view class="flex-y-center px-8 h-38 lh-36rpx rd-8rpx fs-18 con-border text-primary-con">
|
||||
{{item.giveProducts.length + item.giveCoupon.length}}件赠品
|
||||
</view>
|
||||
<view class="ml-14 flex-1" @tap="showGiftChange">
|
||||
<view class="flex-between-center">
|
||||
<view class="fs-24 lh-34rpx">下单享赠品(赠完为止)</view>
|
||||
<text class="iconfont icon-ic_rightarrow fs-24 text--w111-999"></text>
|
||||
</view>
|
||||
<view class="flex pt-12" v-if="item.giveProducts.length <= 4">
|
||||
<view class="w-84 h-84 rd-8rpx bg--w111-f5f5f5 flex-center mr-16" v-if="item.giveCoupon.length">
|
||||
<text class="gold iconfont icon-a-ic_discount1"></text>
|
||||
</view>
|
||||
<view class="w-84 h-84 rd-8rpx bg--w111-f5f5f5 flex-center mr-16" v-if="item.give_integral">
|
||||
<text class="gold iconfont icon-ic_badge11"></text>
|
||||
</view>
|
||||
<image :src="pro.image" class="w-84 h-84 rd-8rpx block mr-16"
|
||||
v-for="(pro,i) in item.giveProducts" :key="i"></image>
|
||||
</view>
|
||||
<scroll-view scroll-x="true" class="white-nowrap vertical-middle w-562 pt-12" v-else>
|
||||
<view class="w-full h-full flex-y-center">
|
||||
<view class="inline-block ml-16" v-if="item.giveCoupon.length">
|
||||
<view class="w-84 h-84 rd-8rpx bg--w111-f5f5f5 flex-center mr-16">
|
||||
<text class="gold iconfont icon-a-ic_discount1"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inline-block ml-16" v-if="item.give_integral">
|
||||
<view class="w-84 h-84 rd-8rpx bg--w111-f5f5f5 flex-center mr-16">
|
||||
<text class="gold iconfont icon-ic_badge11"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inline-block mr-16" v-for="(pro,i) in item.giveProducts" :key="i">
|
||||
<image :src="pro.image" class="w-84 h-84 rd-8rpx"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-24" v-if="coupon.list.length">
|
||||
<view class="text--w111-333 fs-24 mt-48 lh-34rpx">可领取优惠券</view>
|
||||
<view v-for="(item, index) in coupon.list" :key="index">
|
||||
<view class="mt-24 h-170 bg--w111-fff text-center rd-16rpx flex">
|
||||
<view class="left-bg bg-gradient">
|
||||
<view class="left-container w-full h-full relative flex-col flex-between-center py-32">
|
||||
<baseMoney
|
||||
:money="item.coupon_price"
|
||||
symbolSize="28"
|
||||
integerSize="52"
|
||||
decimalSize="28"
|
||||
color="#ffffff"
|
||||
isCoupon
|
||||
v-if="item.coupon_type == 1"></baseMoney>
|
||||
<view v-else class="text--w111-fff fs-44 SemiBold">{{ parseFloat(item.coupon_price) / 10 }} <text class="pingfang fs-28 pl-4">折</text></view>
|
||||
<text class="fs-24 text--w111-fff" v-show="item.use_min_price == 0">无门槛券</text>
|
||||
<text class="fs-24 text--w111-fff" v-show="item.use_min_price != 0">满{{ item.use_min_price }}元可用</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-box pt-24 pl-24 pr-14 pb-22 flex-1 flex-col justify-between bg--w111-fff">
|
||||
<view class="flex-y-center">
|
||||
<view class="fs-28 fw-500 text--w111-333 lh-40rpx">{{ item.coupon_title }}</view>
|
||||
</view>
|
||||
<view class="flex-between-center">
|
||||
<view class="fs-20 text--w111-666 lh-28rpx" v-if="item.coupon_time">领取后{{ item.coupon_time }}天内可用</view>
|
||||
<view class="fs-20 text--w111-666 lh-28rpx" v-else>{{ item.start_time ? item.start_time + '-' : '' }}{{ item.end_time }}</view>
|
||||
<view class="con_btn bg-primary-light text-primary-con w-136 h-52 rd-28rpx fs-22 flex-center" @tap="getCouponUser(item, index)">
|
||||
{{ item.is_use ? '去使用' : '立即领取' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-y-center fs-20 text--w111-999 lh-28rpx mt-20">
|
||||
<text>{{item.type | typeFilter}}</text>
|
||||
<view v-show="item.rule" @tap.stop="toggleRule(index)">
|
||||
<text class="pl-8"> | 查看用券规则</text>
|
||||
<text class="iconfont icon-ic_downarrow fs-20 ml-4"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rule-desc" v-show="item.ruleshow" v-html="item.rule"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- <view class="mx-20 pb-safe">
|
||||
<view class="mt-52 h-72 flex-center rd-36px bg-color fs-26 text--w111-fff" @tap="closeDrawer">确定</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</base-drawer>
|
||||
<base-drawer mode="bottom" :visible="showGift" background-color="transparent" mask maskClosable @close="showGiftChange">
|
||||
<view class="w-full bg--w111-fff rd-t-40rpx py-32 relative">
|
||||
<view class="text-center fs-32 text--w111-333 fw-500">赠品</view>
|
||||
<view class="close-icon flex-center" @tap='showGiftChange'>
|
||||
<text class="iconfont icon-ic_close fs-24 text--w111-999"></text>
|
||||
</view>
|
||||
<view class="mt-48 px-30">
|
||||
<scroll-view scroll-y="true" style="height: 800rpx;">
|
||||
<view class="flex-between-center gift-cell" v-for="(item,i) in giveCoupon" :key="i">
|
||||
<view class="w-160 h-160 rd-16rpx flex-center bg--w111-f5f5f5">
|
||||
<text class="fs-60 gold iconfont icon-a-ic_discount1"></text>
|
||||
</view>
|
||||
<view class="flex-1 flex-between-center pl-30">
|
||||
<view class="w-500 h-160 flex-col justify-between">
|
||||
<view class="w-full line2 fs-28 lh-40rpx">{{item.coupon_title}}</view>
|
||||
<view class="fs-22 text--w111-999 lh-30rpx mt-12">数量x1</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between-center gift-cell" v-if="give_integral">
|
||||
<view class="w-160 h-160 rd-16rpx flex-center bg--w111-f5f5f5">
|
||||
<text class="fs-60 gold iconfont icon-ic_badge11"></text>
|
||||
</view>
|
||||
<view class="flex-1 flex-between-center pl-30">
|
||||
<view class="w-500 h-160 flex-col justify-between">
|
||||
<view class="w-full line2 fs-28 lh-40rpx">赠送积分</view>
|
||||
<view class="fs-22 text--w111-999 lh-30rpx mt-12">数量x{{give_integral}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between-center gift-cell" v-for="(item,index) in giveProducts" :key="index">
|
||||
<image class="w-160 h-160 rd-16rpx" :src="item.image"></image>
|
||||
<view class="flex-1 flex-between-center pl-30">
|
||||
<view class="w-500 h-160 flex-col justify-between">
|
||||
<view class="w-full line2 fs-28 lh-40rpx">{{item.store_name}}</view>
|
||||
<view class="fs-22 text--w111-999 lh-30rpx mt-12">数量x1</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</base-drawer>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
.gradient-box{
|
||||
background: linear-gradient( 180deg, #FFFFFF 0%, #f5f5f5 100%);
|
||||
}
|
||||
.scroll-content{
|
||||
/* #ifdef MP-WEIXIN || APP-PLUS */
|
||||
max-height: 1176rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
max-height: 800rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.border_bg {
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
border: 1rpx solid var(--view-theme);
|
||||
border-radius: 16rpx;
|
||||
background-size: 100%;
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -1rpx;
|
||||
left: 50%;
|
||||
width: 18rpx;
|
||||
height: 18rpx;
|
||||
border: 1rpx solid var(--view-theme);
|
||||
background-color: #f5f5f5;
|
||||
box-sizing: border-box;
|
||||
transform: rotate(45deg) translate(-50%);
|
||||
}
|
||||
}
|
||||
.border_bg:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background-color: #fff;
|
||||
transform: translateX(-50%);
|
||||
// border-bottom-color: #f5f5f5;
|
||||
// top: -9px;
|
||||
}
|
||||
.left-bg {
|
||||
width: 190rpx;
|
||||
height: 170rpx;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
border-radius: 24rpx 0 0 24rpx;
|
||||
}
|
||||
.right-box {
|
||||
border-radius: 0 24rpx 24rpx 0;
|
||||
}
|
||||
.left-container {
|
||||
background: radial-gradient(circle at 0px 84rpx, #f5f5f5 12rpx, transparent 0px) top;
|
||||
&:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0px;
|
||||
width: 6rpx;
|
||||
height: 100%;
|
||||
background-image: radial-gradient(circle at 6rpx 12rpx, #ffffff 6rpx, transparent 6rpx);
|
||||
background-size: 6rpx 18rpx;
|
||||
}
|
||||
}
|
||||
.text-primary-con {
|
||||
color: var(--view-theme);
|
||||
}
|
||||
.bg-primary-light {
|
||||
background: var(--view-minorColorT);
|
||||
}
|
||||
.con-border {
|
||||
border: 1rpx solid var(--view-theme);
|
||||
}
|
||||
.w-512{
|
||||
width: 512rpx;
|
||||
}
|
||||
|
||||
.reduce {
|
||||
width: 18rpx;
|
||||
height: 4rpx;
|
||||
background-color: var(--view-theme);
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
.card-cell ~ .card-cell {
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.rule-desc {
|
||||
margin-top: -16rpx;
|
||||
padding: 40rpx 24rpx 24rpx;
|
||||
white-space: pre-wrap;
|
||||
font-size: 20rpx;
|
||||
line-height: 28rpx;
|
||||
background: linear-gradient(180deg, #f7f7f7 0%, #ffffff 100%);
|
||||
border-radius: 0 0 16rpx 16rpx;
|
||||
color: #999;
|
||||
}
|
||||
.w-500{
|
||||
width: 500rpx;
|
||||
}
|
||||
.gold{
|
||||
color: #DCA658;
|
||||
}
|
||||
.gift-cell ~ .gift-cell{
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.close-icon{
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 36rpx;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #eee;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,46 @@
|
||||
<script>
|
||||
import baseDrawer from '@/components/tui-drawer/tui-drawer.vue';
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
ensureInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
baseDrawer
|
||||
},
|
||||
methods: {
|
||||
closeDrawer() {
|
||||
this.$emit('closeDrawer');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<view>
|
||||
<base-drawer mode="bottom" :visible="visible" background-color="transparent" mask maskClosable @close="closeDrawer">
|
||||
<view class="w-full bg--w111-fff rd-t-40rpx py-32">
|
||||
<view class="text-center fs-32 text--w111-333 fw-500 mb-34">服务</view>
|
||||
<scroll-view scroll-y="true" class="h-400">
|
||||
<view class="px-32">
|
||||
<view class="mb-38" v-for="(item, index) in ensureInfo.ensure" :key="index">
|
||||
<view class="flex-y-center">
|
||||
<image class="w-34 h-34" :src="item.image"></image>
|
||||
<text class="pl-12 text--w111-333 fs-28 fw-500">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="mt-6 pl-40 fs-22 text--w111-999">{{ item.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="mx-20 pb-safe">
|
||||
<view class="mt-52 h-72 flex-center rd-36px bg-color fs-26 text--w111-fff" @click="closeDrawer">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-drawer>
|
||||
</view>
|
||||
</template>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<!-- 产品参数 -->
|
||||
<base-drawer mode="bottom" :visible="specsInfo.show" background-color="transparent" mask maskClosable @close="closeSpecs">
|
||||
<view class="w-full bg--w111-fff rd-t-40rpx py-32">
|
||||
<view class="text-center fs-32 text--w111-333 fw-500 mb-34">参数</view>
|
||||
<scroll-view scroll-y="true" class="h-400">
|
||||
<view class="px-32 scroll-content">
|
||||
<view class="item flex break_word" v-for="(item,index) in specsInfo.specs" :key="index">
|
||||
<view class="w-160 text--w111-999 mr-12">{{item.name}}</view>
|
||||
<view class="flex-1">{{item.value}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="mx-20 pb-safe">
|
||||
<view class="mt-52 h-72 flex-center rd-36px bg-color fs-26 text--w111-fff" @click="closeSpecs">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import baseDrawer from '@/components/tui-drawer/tui-drawer.vue';
|
||||
export default {
|
||||
props: {
|
||||
specsInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
baseDrawer
|
||||
},
|
||||
methods: {
|
||||
closeSpecs() {
|
||||
this.$emit('myevent');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.item ~ .item{
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user