|
@@ -27,27 +27,52 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list_2" v-for="(tag,index) in item.goods" :key="index">
|
|
|
- <view class="l">
|
|
|
- <image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''"
|
|
|
- mode=""></image>
|
|
|
- </view>
|
|
|
- <view class="c">
|
|
|
- <view class="name">
|
|
|
- {{tag.goods_name}}
|
|
|
+ <view class="list_2_1">
|
|
|
+ <view class="l">
|
|
|
+ <image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''"
|
|
|
+ mode=""></image>
|
|
|
</view>
|
|
|
- <view class="Spec">
|
|
|
- 规格:{{tag.goodsSpec_name}}
|
|
|
+ <view class="c">
|
|
|
+ <view class="name">
|
|
|
+ {{tag.goods_name}}
|
|
|
+ </view>
|
|
|
+ <view class="Spec">
|
|
|
+ 规格:{{tag.goodsSpec_name}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="r">
|
|
|
- <view class="price" v-if="type=='0'">
|
|
|
- ¥{{tag.price}}
|
|
|
+ <view class="r">
|
|
|
+ <view class="price" v-if="type=='0'">
|
|
|
+ ¥{{tag.price}}
|
|
|
+ </view>
|
|
|
+ <view v-else class="price">
|
|
|
+ ¥{{tag.group_sell_money}}
|
|
|
+ </view>
|
|
|
+ <view class="num">
|
|
|
+ ×{{tag.num}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view v-else class="price">
|
|
|
- ¥{{tag.group_sell_money}}
|
|
|
+ </view>
|
|
|
+ <view class="list_2_2" v-if="tag.gift.length>0">赠品</view>
|
|
|
+ <view class="list_2_3" v-if="tag.gift.length>0" v-for="(tags,indexx) in tag.gift"
|
|
|
+ :key="indexx">
|
|
|
+ <view class="left">
|
|
|
+ <view class="name">
|
|
|
+ {{tags.goods_name}}
|
|
|
+ </view>
|
|
|
+ <view class="Spec">
|
|
|
+ 规格:{{tags.spec_name}}
|
|
|
+ </view>
|
|
|
+ <view class="Spec">
|
|
|
+ 说明:{{tags.desc}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="num">
|
|
|
- ×{{tag.num}}
|
|
|
+ <view class="right">
|
|
|
+ <view class="price">
|
|
|
+ ¥{{tags.money||0}}
|
|
|
+ </view>
|
|
|
+ <view class="num">
|
|
|
+ ×{{tags.num}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -70,32 +95,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="act" v-if="total>0">
|
|
|
- <view class="act_1">
|
|
|
- 订单已满<text>{{act.money||0}}</text>元,为你推荐优惠商品搭配
|
|
|
- </view>
|
|
|
- <view class="act_2">
|
|
|
- <checkbox-group @change="checkboxChange">
|
|
|
- <label class="actList" v-for="(item,index) in actList" :key="index">
|
|
|
- <image class="image"
|
|
|
- :src="item.file.length>0?item.file[0].url:item.file[0].url"
|
|
|
- mode="aspectFill"></image>
|
|
|
- <view class="name">{{item.goods_name}}</view>
|
|
|
- <view class="money">
|
|
|
- <text class="text_1">¥{{item.flow_money}}</text>
|
|
|
- <text class="text_2">¥{{item.sell_money}}</text>
|
|
|
- </view>
|
|
|
- <view class="checkbox">
|
|
|
- <checkbox color="#FB1438" style="transform:scale(0.7)" :value="item._id"
|
|
|
- :checked="item.checked" />
|
|
|
- </view>
|
|
|
- </label>
|
|
|
- </checkbox-group>
|
|
|
- <view class="bottom" @tap="toOpen">
|
|
|
- <text
|
|
|
- :class="[change==false?'iconfont icon-xiajiantou-copy':'iconfont icon-shangjiantou-copy']"></text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view class="other" v-for="(item,index) in total_detail" :key="index">
|
|
|
+ <view class="other_1">{{item.zh}}</view>
|
|
|
+ <view class="other_2">¥{{item.money}}</view>
|
|
|
</view>
|
|
|
<view class="other" v-if="type=='0'">
|
|
|
<view class="other_1">优惠劵</view>
|
|
@@ -104,6 +106,10 @@
|
|
|
</view>
|
|
|
<view class="other_2" v-else>暂无优惠劵使用</view>
|
|
|
</view>
|
|
|
+ <view class="other" v-if="total>0&&actInfo" @tap="toAddGoods">
|
|
|
+ <view class="other_1">加购商品</view>
|
|
|
+ <view class="other_4">去加购></view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -125,6 +131,36 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
+ <uni-drawer ref="showRight" :mask="false" :width="width" mode="right" :mask-click="false">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
+ <view class="act">
|
|
|
+ <view class="act_1">
|
|
|
+ 订单已满<text>{{actInfo.plus_money}}</text>元,为你推荐优惠商品搭配
|
|
|
+ </view>
|
|
|
+ <view class="act_2">
|
|
|
+ <checkbox-group @change="checkboxChange">
|
|
|
+ <label class="actList" v-for="(item,index) in actList" :key="index">
|
|
|
+ <image class="image" :src="item.file.length>0?item.file[0].url:item.file[0].url"
|
|
|
+ mode="aspectFill"></image>
|
|
|
+ <view class="name">{{item.goods_name}}</view>
|
|
|
+ <view class="money">
|
|
|
+ <text class="text_1">¥{{item.flow_money||0}}</text>
|
|
|
+ <text class="text_2">¥{{item.config.plus_money||item.sell_money}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="checkbox">
|
|
|
+ <checkbox color="#FB1438" style="transform:scale(0.7)" :value="item._id"
|
|
|
+ :checked="item.checked" />
|
|
|
+ </view>
|
|
|
+ </label>
|
|
|
+ </checkbox-group>
|
|
|
+ </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <button @click="closeDrawer('define')" size="mini">确认加购</button>
|
|
|
+ <button @click="closeDrawer('cancel')" size="mini">取消加购</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </uni-drawer>
|
|
|
</mobile-frame>
|
|
|
</template>
|
|
|
|
|
@@ -151,7 +187,7 @@
|
|
|
shop: [],
|
|
|
goods_total: 0,
|
|
|
// 金额明细
|
|
|
- total_detail: {},
|
|
|
+ total_detail: [],
|
|
|
// 收货地址
|
|
|
addressList: [],
|
|
|
// 优惠劵
|
|
@@ -167,11 +203,16 @@
|
|
|
inviter: '',
|
|
|
// 活动商品
|
|
|
actList: [],
|
|
|
+ // 加价购活动
|
|
|
+ actInfo: {},
|
|
|
+ // 加购商品
|
|
|
+ plus_goods: [],
|
|
|
total: 0,
|
|
|
page: 0,
|
|
|
skip: 0,
|
|
|
- limit: 5,
|
|
|
- change: false,
|
|
|
+ limit: 20,
|
|
|
+ // 抽屉
|
|
|
+ width: '100%'
|
|
|
};
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
@@ -222,7 +263,12 @@
|
|
|
})
|
|
|
if (arr.errcode == '0') {
|
|
|
// 查询活动商品列表
|
|
|
- that.searchAct();
|
|
|
+ let act;
|
|
|
+ act = arr.data.actList.find(i => i.platform_act_type == '4')
|
|
|
+ if (act) {
|
|
|
+ that.searchAct(act);
|
|
|
+ that.$set(that, `actInfo`, act);
|
|
|
+ }
|
|
|
// 分享人id
|
|
|
that.$set(that, `inviter`, arr.data.inviter);
|
|
|
// 地址
|
|
@@ -238,12 +284,13 @@
|
|
|
}
|
|
|
},
|
|
|
// 查询活动商品列表
|
|
|
- async searchAct() {
|
|
|
+ async searchAct(e) {
|
|
|
const that = this;
|
|
|
+ let platform_act = e.platform_act;
|
|
|
let info = {
|
|
|
skip: that.skip,
|
|
|
limit: that.limit,
|
|
|
- platform_act: '6371dad40aa8e005d5a47832',
|
|
|
+ platform_act: platform_act,
|
|
|
goods_type: 'plus'
|
|
|
}
|
|
|
let res = await that.$api(`/goodsJoinAct`, 'GET', {
|
|
@@ -261,7 +308,7 @@
|
|
|
that.$set(that, 'coupon_name', e.name)
|
|
|
that.coupon.push(e._id)
|
|
|
that.$refs.popup.close();
|
|
|
- this.computedTotal();
|
|
|
+ that.computedTotal();
|
|
|
},
|
|
|
// 选择收货地址
|
|
|
toChoose() {
|
|
@@ -294,10 +341,35 @@
|
|
|
else that.$set(item, 'checked', false)
|
|
|
}
|
|
|
},
|
|
|
- // 展开更多
|
|
|
- toOpen() {
|
|
|
+ // 选择加购产品
|
|
|
+ toAddGoods() {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, 'plus_goods', [])
|
|
|
+ that.$refs.showRight.open();
|
|
|
+ },
|
|
|
+ // 关闭抽屉
|
|
|
+ closeDrawer(e) {
|
|
|
+ const that = this;
|
|
|
+ if (e == 'cancel') {
|
|
|
+ for (let val of that.actList) {
|
|
|
+ if (val.checked == true) val.checked = false
|
|
|
+ }
|
|
|
+ that.$set(that, 'plus_goods', []);
|
|
|
+ that.computedTotal();
|
|
|
+ that.$refs.showRight.close();
|
|
|
+ } else {
|
|
|
+ // 选购中商品
|
|
|
+ let plus_goods = that.actList.filter(item => item.checked == true)
|
|
|
+ that.$set(that, 'plus_goods', plus_goods);
|
|
|
+ that.computedTotal();
|
|
|
+ that.$refs.showRight.close();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 分页
|
|
|
+ toPage() {
|
|
|
const that = this;
|
|
|
let list = that.actList;
|
|
|
+ let actInfo = that.actInfo;
|
|
|
let limit = that.limit;
|
|
|
if (that.total > list.length) {
|
|
|
uni.showLoading({
|
|
@@ -308,16 +380,13 @@
|
|
|
that.$set(that, `page`, page)
|
|
|
let skip = page * limit;
|
|
|
that.$set(that, `skip`, skip)
|
|
|
- that.searchAct();
|
|
|
+ that.searchAct(actInfo);
|
|
|
uni.hideLoading();
|
|
|
- that.$set(that, 'change', true);
|
|
|
- } else if (that.total == list.length) {
|
|
|
- that.$set(that, `actList`, [])
|
|
|
- that.$set(that, `skip`, 0)
|
|
|
- that.$set(that, `limit`, 5)
|
|
|
- that.$set(that, `page`, 0)
|
|
|
- that.$set(that, `change`, false)
|
|
|
- that.searchAct();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: `没有更多商品了`,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 提交订单
|
|
@@ -331,7 +400,8 @@
|
|
|
total_detail: that.total_detail,
|
|
|
coupon: that.coupon,
|
|
|
type: that.type,
|
|
|
- inviter: that.inviter
|
|
|
+ inviter: that.inviter,
|
|
|
+ plus_goods: that.plus_goods
|
|
|
}
|
|
|
if (that.group_id) obj.group = that.group_id;
|
|
|
// 创建订单
|
|
@@ -421,10 +491,19 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ // 计算优惠券
|
|
|
async computedTotal() {
|
|
|
const total_detail = this.total_detail;
|
|
|
- let total = this.$plus(total_detail.freight_total, total_detail.goods_total)
|
|
|
+ let total = 0;
|
|
|
+ for (let val of total_detail) total = this.$plus(total, val.money)
|
|
|
+ if (this.plus_goods.length > 0) {
|
|
|
+ let plus_total = 0;
|
|
|
+ for (let val of this.plus_goods) {
|
|
|
+ if (val.config.plus_money) plus_total = this.$plus(plus_total, val.config.plus_money)
|
|
|
+ else plus_total = this.$plus(plus_total, val.sell_money)
|
|
|
+ }
|
|
|
+ total = this.$plus(plus_total, total)
|
|
|
+ }
|
|
|
if (this.coupon.length > 0) {
|
|
|
let discount = 0;
|
|
|
for (const coupon of this.coupon) {
|
|
@@ -533,32 +612,60 @@
|
|
|
|
|
|
.list_2 {
|
|
|
padding: 2vw;
|
|
|
- display: flex;
|
|
|
background-color: var(--mainColor);
|
|
|
|
|
|
- .l {
|
|
|
- width: 20vw;
|
|
|
+ .list_2_1 {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .l {
|
|
|
+ width: 20vw;
|
|
|
|
|
|
- .image {
|
|
|
- width: 100%;
|
|
|
- height: 20vw;
|
|
|
- border-radius: 5px;
|
|
|
+ .image {
|
|
|
+ width: 100%;
|
|
|
+ height: 20vw;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .c {
|
|
|
- width: 60vw;
|
|
|
- padding: 0 2vw;
|
|
|
+ .c {
|
|
|
+ width: 60vw;
|
|
|
+ padding: 0 2vw;
|
|
|
|
|
|
- .Spec {
|
|
|
- font-size: var(--font12Size);
|
|
|
- color: var(--f85Color);
|
|
|
+ .Spec {
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ color: var(--f85Color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .r {
|
|
|
+ width: 15vw;
|
|
|
+ text-align: right;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .r {
|
|
|
- width: 15vw;
|
|
|
- text-align: right;
|
|
|
+ .list_2_2 {
|
|
|
+ padding: 0 1vw 1vw 0;
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+
|
|
|
+ .list_2_3 {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ border: 1px solid var(--fcColor);
|
|
|
+ border-radius: 5px;
|
|
|
+ margin: 0 0 1vw 0;
|
|
|
+ padding: 1vw;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ .name {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .Spec {
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ color: var(--f85Color);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -593,71 +700,11 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .act {
|
|
|
- background-color: var(--mainColor);
|
|
|
- border-bottom: 0.1vw solid var(--fcColor);
|
|
|
- margin: 0 0 2vw 0;
|
|
|
- width: 96vw;
|
|
|
- padding: 2vw;
|
|
|
-
|
|
|
- .act_1 {
|
|
|
- font-size: var(--font14Size);
|
|
|
- font-weight: bold;
|
|
|
-
|
|
|
- text {
|
|
|
- color: #FFA500;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .act_2 {
|
|
|
- .actList {
|
|
|
- display: flex;
|
|
|
- margin: 2vw 0;
|
|
|
-
|
|
|
- .image {
|
|
|
- width: 12vw;
|
|
|
- height: 10vw;
|
|
|
- border: 1px solid #ffffff;
|
|
|
- }
|
|
|
-
|
|
|
- .name {
|
|
|
- width: 52vw;
|
|
|
- font-size: 12px;
|
|
|
- margin: 0 0 0 1vw;
|
|
|
- }
|
|
|
-
|
|
|
- .money {
|
|
|
- width: 25vw;
|
|
|
-
|
|
|
- .text_1 {
|
|
|
- font-size: 12px;
|
|
|
- color: #858585;
|
|
|
- text-decoration: line-through;
|
|
|
- }
|
|
|
-
|
|
|
- .text_2 {
|
|
|
- font-size: 14px;
|
|
|
- color: #ff0000;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .checkbox {
|
|
|
- width: 7vw;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .bottom {
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
.other {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
background-color: var(--mainColor);
|
|
|
border-bottom: 0.1vw solid var(--fcColor);
|
|
|
- margin: 0 0 2vw 0;
|
|
|
width: 96vw;
|
|
|
padding: 2vw;
|
|
|
|
|
@@ -672,6 +719,10 @@
|
|
|
font-size: var(--font12Size);
|
|
|
}
|
|
|
|
|
|
+ .other_4 {
|
|
|
+ color: var(--fFB1Color);
|
|
|
+ }
|
|
|
+
|
|
|
text {
|
|
|
padding: 0 1vw 0 0;
|
|
|
font-size: var(--font20Szie);
|
|
@@ -770,4 +821,69 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .act {
|
|
|
+ background-color: var(--mainColor);
|
|
|
+ width: 96vw;
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ .act_1 {
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ text {
|
|
|
+ color: #FFA500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .act_2 {
|
|
|
+ margin: 1vw 0;
|
|
|
+
|
|
|
+ .actList {
|
|
|
+ display: flex;
|
|
|
+ margin: 2vw 0;
|
|
|
+
|
|
|
+ .image {
|
|
|
+ width: 12vw;
|
|
|
+ height: 10vw;
|
|
|
+ border: 1px solid #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ width: 52vw;
|
|
|
+ font-size: 12px;
|
|
|
+ margin: 0 0 0 1vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .money {
|
|
|
+ width: 20vw;
|
|
|
+
|
|
|
+ .text_1 {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #858585;
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text_2 {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #ff0000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .checkbox {
|
|
|
+ width: 7vw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ button:first-child {
|
|
|
+ margin: 0 1vw 0 0;
|
|
|
+ background-color: #ff0000;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|