6.9
This commit is contained in:
106
pageC/cart/ConfirmOrder.vue
Normal file
106
pageC/cart/ConfirmOrder.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<view class="order">
|
||||
<view class="info-address">
|
||||
<image src="../static/image/2.png" class="address-icon"></image>
|
||||
<view class="address">
|
||||
<view class="user-info">
|
||||
<view>胖胖</view>
|
||||
<view>18220171014</view>
|
||||
</view>
|
||||
<view class="address-text u-line-2">山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻</view>
|
||||
</view>
|
||||
<image src="../static/image/1.png" class="right"></image>
|
||||
</view>
|
||||
<view class="main">
|
||||
<view class="goods-info">
|
||||
<view class="store">
|
||||
<image></image>
|
||||
<view>胖胖的店</view>
|
||||
</view>
|
||||
<view class="goods">
|
||||
<view v-for="(goods, g_index) in 1" :key="g_index" class="goods-item">
|
||||
<image></image>
|
||||
<view class="info">
|
||||
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
|
||||
<view class="cart-info">
|
||||
<view class="price">¥99</view>
|
||||
<view class="num">
|
||||
<view class="reduce">-</view>
|
||||
<view class="value">2</view>
|
||||
<view class="increase">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view>
|
||||
<view>优惠券折扣</view>
|
||||
<view>
|
||||
<view>-¥10.00</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>配送方式</view>
|
||||
<view>
|
||||
<view>快递</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>支付方式</view>
|
||||
<view>
|
||||
<view>微信</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.order {
|
||||
.info-address {
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
background:rgba(255,255,255,1);
|
||||
.address-icon {
|
||||
width: 28rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 31rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.address-right {
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
margin-bottom: 20rpx;
|
||||
margin-right: 13rpx;
|
||||
}
|
||||
.address-text {
|
||||
font-size: 24rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
line-height: 42rpx;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
margin-left: auto;
|
||||
width: 12rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
298
pageC/cart/index.vue
Normal file
298
pageC/cart/index.vue
Normal file
@@ -0,0 +1,298 @@
|
||||
<template>
|
||||
<view class="cart">
|
||||
<u-checkbox-group class="cart-main" @change="storeChange">
|
||||
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
|
||||
<view class="store">
|
||||
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
||||
<view class="name">
|
||||
<image></image>
|
||||
<view>胖胖的店</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods">
|
||||
<u-checkbox-group @change="goodsChange($event, s_index)">
|
||||
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
|
||||
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index" ></u-checkbox>
|
||||
<image></image>
|
||||
<view class="info">
|
||||
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
|
||||
<view class="cart-info">
|
||||
<view class="price">¥99</view>
|
||||
<view class="num">
|
||||
<view class="reduce">-</view>
|
||||
<view class="value">2</view>
|
||||
<view class="increase">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<view class="balance">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
||||
全选
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="total-price" v-if="status == '编辑'">
|
||||
<view class="title">合计:</view>
|
||||
<view class="value">¥9.80</view>
|
||||
</view>
|
||||
<view class="cart-btn" v-if="status == '编辑'">结算</view>
|
||||
<view class="delete-btn" v-if="status == '完成'">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
status: '编辑',
|
||||
list: [
|
||||
{
|
||||
goods: [
|
||||
{
|
||||
checked: false
|
||||
},
|
||||
{
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
checked: false
|
||||
},
|
||||
{
|
||||
goods: [
|
||||
{
|
||||
checked: false
|
||||
},
|
||||
{
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
checkedAll: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
totalChange(e) {
|
||||
// 切换所有商品的状态
|
||||
this.list.forEach(store => {
|
||||
store.checked = e.value;
|
||||
store.goods.forEach(goods => {
|
||||
goods.checked = store.checked;
|
||||
})
|
||||
})
|
||||
},
|
||||
storeChange() {
|
||||
// 判断所有商家状态
|
||||
let checked = true;
|
||||
this.list.forEach(item => {
|
||||
if(!item.checked) checked = false;
|
||||
})
|
||||
this.checkedAll = checked;
|
||||
},
|
||||
storeaAloneChange(e) {
|
||||
// 切换当前商家的商品状态
|
||||
this.list[e.name].goods.forEach(goods => {
|
||||
goods.checked = e.value;
|
||||
})
|
||||
},
|
||||
goodsChange(...value) {
|
||||
// console.log(value)
|
||||
// 判断商品是否全选
|
||||
let checked = true;
|
||||
this.list[value[1]].goods.forEach(item => {
|
||||
if(!item.checked) checked = false;
|
||||
})
|
||||
this.list[value[1]].checked = checked;
|
||||
this.storeChange();
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(btn) {
|
||||
console.log(btn);
|
||||
// this.status = btn.text;
|
||||
// #ifdef H5
|
||||
if(this.status == '编辑'){
|
||||
this.status = "完成";
|
||||
} else {
|
||||
this.status = "编辑";
|
||||
}
|
||||
console.log(this.status);
|
||||
// #endif
|
||||
if(btn.index == 0){
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
// #ifdef APP-PLUS
|
||||
let currentWebview = page.$getAppWebview();
|
||||
let titleObj = currentWebview.getStyle().titleNView;
|
||||
console.log(1);
|
||||
console.log(JSON.stringify(titleObj.buttons[0]));
|
||||
if (!titleObj.buttons) {
|
||||
return;
|
||||
}
|
||||
if(titleObj.buttons[0].text == '编辑'){
|
||||
titleObj.buttons[0].text = "完成";
|
||||
}else{
|
||||
titleObj.buttons[0].text = "编辑";
|
||||
}
|
||||
currentWebview.setStyle({
|
||||
titleNView: titleObj
|
||||
});
|
||||
// #endif
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.cart {
|
||||
padding-bottom: 100rpx;
|
||||
.cart-main {
|
||||
display: block;
|
||||
.cart-item {
|
||||
padding: 40rpx 30rpx;
|
||||
.store {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
.u-checkbox {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
> image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
border: 1rpx solid #000;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
> view {
|
||||
font-size: 28rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.goods {
|
||||
.u-checkbox-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.goods-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
> image {
|
||||
margin: 0 30rpx 0 20rpx;
|
||||
width: 180rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: aqua;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info {
|
||||
width: 418rpx;
|
||||
height: 160rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.cart-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.price {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255,49,49,1);
|
||||
}
|
||||
.num {
|
||||
display: flex;
|
||||
width: 118rpx;
|
||||
height: 39rpx;
|
||||
border: 1rpx solid rgba(217,215,215,1);
|
||||
border-radius:4px;
|
||||
.reduce, .increase {
|
||||
flex: 1;
|
||||
font-size: 11rpx;
|
||||
color: #FF780F;
|
||||
line-height: 39rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
font-size: 22rpx;
|
||||
color:rgba(51,51,51,1);
|
||||
line-height: 39rpx;
|
||||
text-align: center;
|
||||
border: 1rpx #D9D7D7 solid {
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.balance {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
height: 98rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
.total-price {
|
||||
margin-left: auto;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.title {
|
||||
color: #333333;
|
||||
}
|
||||
.value {
|
||||
color: #FF3131;
|
||||
}
|
||||
}
|
||||
.cart-btn {
|
||||
margin-left: 50rpx;
|
||||
justify-items: flex-end;
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(255,120,15,1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 30rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.delete-btn {
|
||||
margin-left: auto;
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(255,49,49,1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 30rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user