|
@@ -1,59 +1,34 @@
|
|
|
<template>
|
|
|
<mobile-frame>
|
|
|
<view class="main">
|
|
|
- <view class="one">
|
|
|
- <view class="one_1" v-if="barActive=='0'">
|
|
|
- <scroll-view scroll-y="true" class="scroll-view">
|
|
|
- <view class="content">
|
|
|
- <u-parse :content="info.content.value"></u-parse>
|
|
|
- </view>
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- <view class="one_2" v-else-if="barActive=='1'">
|
|
|
- <view class="one_2_1">
|
|
|
- <input type="text" v-model="searchInfo.goods_name" @blur="toInput" placeholder="搜索商品">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
+ <view class="list-scroll-view">
|
|
|
+ <view class="one">
|
|
|
+ <u-parse :content="info.content.value"></u-parse>
|
|
|
</view>
|
|
|
- <view class="one_2_2">
|
|
|
- <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
- <view class="list-scroll-view">
|
|
|
- <view class="pubu">
|
|
|
- <view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
|
|
|
- <view class="img">
|
|
|
- <image class="image" :src="item.goods.file&&item.goods.file.length?item.goods.file[0].url:''" mode=""></image>
|
|
|
- </view>
|
|
|
- <view class="name">
|
|
|
- <text>{{item.goods.name}}</text>
|
|
|
- </view>
|
|
|
- <view class="money">
|
|
|
- <view class="money_1">
|
|
|
- <text>¥</text><text>{{item.sell_money||0}}</text>
|
|
|
- </view>
|
|
|
- <view class="money_2">
|
|
|
- <text>¥</text><text>{{item.flow_money||0}}</text>
|
|
|
- </view>
|
|
|
- <!-- <text>¥</text>
|
|
|
- <text>{{item.sell_money}}</text> -->
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
|
|
|
+ <view class="img">
|
|
|
+ <image class="image" :src="item.goods.file&&item.goods.file.length?item.goods.file[0].url:''" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view class="name">
|
|
|
+ <text>{{item.goods.name}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="money">
|
|
|
+ <view class="money_1">
|
|
|
+ <text>¥</text><text>{{item.sell_money||0}}</text>
|
|
|
</view>
|
|
|
- <view class="is_bottom" v-if="is_bottom">
|
|
|
- <text>{{config.bottom_title}}</text>
|
|
|
+ <view class="money_2">
|
|
|
+ <text>¥</text><text>{{item.flow_money||0}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="two">
|
|
|
- <view class="list" v-for="(item,index) in barList" :key="index" @tap="barChange(index,item)">
|
|
|
- <view class="icon">
|
|
|
- <text :class="['iconfont',barActive==index?item.acticon:item.icon]"></text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view :class="['name',barActive==index?'activename':'']">
|
|
|
- {{item.name}}
|
|
|
+ <view class="is_bottom" v-if="is_bottom">
|
|
|
+ <text>{{config.bottom_title}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view>
|
|
|
</view>
|
|
|
</mobile-frame>
|
|
|
</template>
|
|
@@ -69,19 +44,6 @@
|
|
|
// 系统设置
|
|
|
config: {},
|
|
|
id: '',
|
|
|
- barActive: '0',
|
|
|
- barList: [ //底部菜单
|
|
|
- {
|
|
|
- icon: 'icon-shangdian',
|
|
|
- acticon: "icon-shangdian-copy",
|
|
|
- name: '活动详情'
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-shangpinfenlei',
|
|
|
- acticon: "icon-shangpinfenlei-copy",
|
|
|
- name: '商品列表'
|
|
|
- }
|
|
|
- ],
|
|
|
// 详情
|
|
|
info: {},
|
|
|
// 商品列表
|
|
@@ -90,8 +52,6 @@
|
|
|
page: 0,
|
|
|
skip: 0,
|
|
|
limit: 6,
|
|
|
- // 查询
|
|
|
- searchInfo: {},
|
|
|
// 数据是否触底
|
|
|
is_bottom: false,
|
|
|
scrollTop: 0,
|
|
@@ -122,19 +82,16 @@
|
|
|
},
|
|
|
async searchAct() {
|
|
|
const that = this;
|
|
|
- if (that.id) {
|
|
|
- // 查询详情
|
|
|
- let res = await that.$api(`/platformAct/${that.id}`, 'GET');
|
|
|
- if (res.errcode == '0') {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: res.data.title
|
|
|
- });
|
|
|
- that.$set(that, `info`, res.data)
|
|
|
- }
|
|
|
+ // 查询详情
|
|
|
+ let res = await that.$api(`/platformAct/${that.id}`, 'GET');
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: res.data.title
|
|
|
+ });
|
|
|
+ that.$set(that, `info`, res.data);
|
|
|
that.search()
|
|
|
}
|
|
|
},
|
|
|
- // 查询列表
|
|
|
async search() {
|
|
|
const that = this;
|
|
|
// 查询商品列表
|
|
@@ -145,7 +102,6 @@
|
|
|
}
|
|
|
let res = await that.$api(`/goodsJoinAct`, 'GET', {
|
|
|
...info,
|
|
|
- ...that.searchInfo
|
|
|
})
|
|
|
if (res.errcode == '0') {
|
|
|
let list = [...that.list, ...res.data];
|
|
@@ -178,14 +134,6 @@
|
|
|
let num = Math.sign(up - e.detail.scrollTop);
|
|
|
if (num == 1) that.$set(that, `is_bottom`, false);
|
|
|
},
|
|
|
- // 输入框
|
|
|
- toInput(e) {
|
|
|
- const that = this;
|
|
|
- if (e.detail.value) that.$set(that.searchInfo, `goods_name`, e.detail.value);
|
|
|
- else that.$set(that, `searchInfo`, {});
|
|
|
- that.clearPage();
|
|
|
- that.search();
|
|
|
- },
|
|
|
// 购买
|
|
|
toBuy(e) {
|
|
|
const that = this;
|
|
@@ -194,11 +142,6 @@
|
|
|
url: `/pagesHome/order/detail?id=${e.goods._id}`
|
|
|
})
|
|
|
},
|
|
|
- // 选择底部菜单
|
|
|
- barChange(index, item) {
|
|
|
- const that = this;
|
|
|
- that.$set(that, `barActive`, index);
|
|
|
- },
|
|
|
// 清空列表
|
|
|
clearPage() {
|
|
|
const that = this;
|
|
@@ -219,123 +162,73 @@
|
|
|
height: 100vh;
|
|
|
|
|
|
.one {
|
|
|
- position: relative;
|
|
|
- flex-grow: 1;
|
|
|
-
|
|
|
- .one_1 {
|
|
|
- height: 92vh;
|
|
|
-
|
|
|
- .content {
|
|
|
- padding: 2vw;
|
|
|
- }
|
|
|
+ padding: 2vw;
|
|
|
|
|
|
- image {
|
|
|
- width: 100% !important;
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 100% !important;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .one_2 {
|
|
|
- height: 92vh;
|
|
|
-
|
|
|
- .one_2_1 {
|
|
|
- border-bottom: 1px solid var(--f85Color);
|
|
|
- padding: 2vw;
|
|
|
- margin: 0 0 2vw 0;
|
|
|
+ .two {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 2vw;
|
|
|
|
|
|
- input {
|
|
|
- padding: 2vw;
|
|
|
- background-color: var(--f1Color);
|
|
|
- font-size: var(--font14Size);
|
|
|
+ .list {
|
|
|
+ padding: 2vw;
|
|
|
+ background-color: var(--f1Color);
|
|
|
+ margin: 0 2vw 2vw 0;
|
|
|
+ border-radius: 5px;
|
|
|
+ width: 43vw;
|
|
|
+
|
|
|
+ .img {
|
|
|
+ .image {
|
|
|
+ width: 100%;
|
|
|
+ height: 30vh;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .one_2_2 {
|
|
|
- position: relative;
|
|
|
- width: 96vw;
|
|
|
- height: 81vh;
|
|
|
- margin: 0 2vw;
|
|
|
-
|
|
|
- .pubu {
|
|
|
- column-count: 2;
|
|
|
- column-gap: 2vw;
|
|
|
-
|
|
|
- .list {
|
|
|
- break-inside: avoid;
|
|
|
- padding: 2vw;
|
|
|
- background-color: var(--f1Color);
|
|
|
- margin: 0 0 2vw 0;
|
|
|
- border-radius: 5px;
|
|
|
-
|
|
|
- .img {
|
|
|
- .image {
|
|
|
- width: 100%;
|
|
|
- height: 30vh;
|
|
|
- border-radius: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .name {
|
|
|
- margin: 0 0 1vw 0;
|
|
|
+ .name {
|
|
|
+ margin: 0 0 1vw 0;
|
|
|
|
|
|
- text {
|
|
|
- font-size: var(--font14Size);
|
|
|
- }
|
|
|
- }
|
|
|
+ text {
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .money {
|
|
|
- display: flex;
|
|
|
+ .money {
|
|
|
+ display: flex;
|
|
|
|
|
|
- .money_1 {
|
|
|
- color: var(--fFB1Color);
|
|
|
- font-size: 12px;
|
|
|
+ .money_1 {
|
|
|
+ color: var(--fFB1Color);
|
|
|
+ font-size: 12px;
|
|
|
|
|
|
- text:last-child {
|
|
|
- font-size: 16px;
|
|
|
- padding: 0 0 0 1vw;
|
|
|
- }
|
|
|
- }
|
|
|
+ text:last-child {
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 0 0 0 1vw;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .money_2 {
|
|
|
- font-size: 12px;
|
|
|
- margin: 0 0 0 2vw;
|
|
|
- color: var(--f99Color);
|
|
|
+ .money_2 {
|
|
|
+ font-size: 12px;
|
|
|
+ margin: 0 0 0 2vw;
|
|
|
+ color: var(--f99Color);
|
|
|
|
|
|
- text {
|
|
|
- text-decoration: line-through;
|
|
|
- }
|
|
|
+ text {
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
|
|
|
- text:last-child {
|
|
|
- font-size: 16px;
|
|
|
- padding: 0 0 0 1vw;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ text:last-child {
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 0 0 0 1vw;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .two {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- justify-content: space-around;
|
|
|
- border-top: 1px solid #f1f1f1;
|
|
|
-
|
|
|
- .list {
|
|
|
- padding: 1vw 0;
|
|
|
- text-align: center;
|
|
|
|
|
|
- .icon {}
|
|
|
-
|
|
|
- .name {
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
-
|
|
|
- .activename {
|
|
|
- color: var(--fFB1Color);
|
|
|
- }
|
|
|
+ .list:nth-child(2n) {
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -353,7 +246,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
.is_bottom {
|
|
|
text-align: center;
|
|
|
width: 100vw;
|