|
@@ -70,27 +70,31 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="act">
|
|
|
+ <view class="act" v-if="total>0">
|
|
|
<view class="act_1">
|
|
|
- 订单已满<text>{{act.money||0}}元,为你推荐优惠商品搭配</text>
|
|
|
+ 订单已满<text>{{act.money||0}}</text>元,为你推荐优惠商品搭配
|
|
|
</view>
|
|
|
<view class="act_2">
|
|
|
<checkbox-group @change="checkboxChange">
|
|
|
- <label class="list" v-for="(item,index) in actList" :key="index">
|
|
|
+ <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>¥{{item.sell_money}}</text>
|
|
|
- <text>¥{{item.flow_money}}</text>
|
|
|
+ <text class="text_1">¥{{item.flow_money}}</text>
|
|
|
+ <text class="text_2">¥{{item.sell_money}}</text>
|
|
|
</view>
|
|
|
<view class="checkbox">
|
|
|
- <checkbox :value="item.value" :checked="item.checked" />
|
|
|
+ <checkbox color="#FB1438" style="transform:scale(0.7)" :value="item._id"
|
|
|
+ :checked="item.checked" />
|
|
|
</view>
|
|
|
</label>
|
|
|
</checkbox-group>
|
|
|
- <view class="bottom"><text class="iconfont icon-xiajiantou-copy"></text></view>
|
|
|
+ <view class="bottom" @tap="toOpen">
|
|
|
+ <text
|
|
|
+ :class="[change==false?'iconfont icon-xiajiantou-copy':'iconfont icon-shangjiantou-copy']"></text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="other" v-if="type=='0'">
|
|
@@ -163,6 +167,11 @@
|
|
|
inviter: '',
|
|
|
// 活动商品
|
|
|
actList: [],
|
|
|
+ total: 0,
|
|
|
+ page: 0,
|
|
|
+ skip: 0,
|
|
|
+ limit: 5,
|
|
|
+ change: false,
|
|
|
};
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
@@ -212,6 +221,8 @@
|
|
|
key: that.key
|
|
|
})
|
|
|
if (arr.errcode == '0') {
|
|
|
+ // 查询活动商品列表
|
|
|
+ that.searchAct();
|
|
|
// 分享人id
|
|
|
that.$set(that, `inviter`, arr.data.inviter);
|
|
|
// 地址
|
|
@@ -226,6 +237,24 @@
|
|
|
that.$set(that, `couponList`, arr.data.couponList);
|
|
|
}
|
|
|
},
|
|
|
+ // 查询活动商品列表
|
|
|
+ async searchAct() {
|
|
|
+ const that = this;
|
|
|
+ let info = {
|
|
|
+ skip: that.skip,
|
|
|
+ limit: that.limit,
|
|
|
+ platform_act: '6371dad40aa8e005d5a47832',
|
|
|
+ goods_type: 'plus'
|
|
|
+ }
|
|
|
+ let res = await that.$api(`/goodsJoinAct`, 'GET', {
|
|
|
+ ...info,
|
|
|
+ })
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ let list = [...that.actList, ...res.data];
|
|
|
+ that.$set(that, `actList`, list)
|
|
|
+ that.$set(that, `total`, res.total)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 使用优惠劵
|
|
|
toDiscount(e) {
|
|
|
const that = this;
|
|
@@ -254,17 +283,39 @@
|
|
|
that.$set(that, 'coupon', [])
|
|
|
that.$refs.popup.open();
|
|
|
},
|
|
|
+ // 选择活动商品
|
|
|
checkboxChange(e) {
|
|
|
const that = this;
|
|
|
var actList = that.actList,
|
|
|
- id = e.detail._id;
|
|
|
+ values = e.detail.value;
|
|
|
for (var i = 0, lenI = actList.length; i < lenI; ++i) {
|
|
|
const item = actList[i]
|
|
|
- if (id.includes(item._id)) {
|
|
|
- this.$set(item, 'checked', true)
|
|
|
- } else {
|
|
|
- this.$set(item, 'checked', false)
|
|
|
- }
|
|
|
+ if (values.includes(item._id)) that.$set(item, 'checked', true)
|
|
|
+ else that.$set(item, 'checked', false)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 展开更多
|
|
|
+ toOpen() {
|
|
|
+ const that = this;
|
|
|
+ let list = that.actList;
|
|
|
+ let limit = that.limit;
|
|
|
+ if (that.total > list.length) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ let page = that.page + 1;
|
|
|
+ that.$set(that, `page`, page)
|
|
|
+ let skip = page * limit;
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
+ that.searchAct();
|
|
|
+ uni.hideLoading();
|
|
|
+ } else {
|
|
|
+ that.$set(that, 'change', true);
|
|
|
+ uni.showToast({
|
|
|
+ title: '没有更多优惠商品了',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 提交订单
|
|
@@ -548,6 +599,57 @@
|
|
|
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 {
|