第一次提交
This commit is contained in:
167
pages/bargain/goods/components/SkuPopup.vue
Executable file
167
pages/bargain/goods/components/SkuPopup.vue
Executable file
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<goods-sku-popup :value="value" @input="onChangeValue" border-radius="20" :localdata="goodsInfo" :mode="skuMode" :maskCloseAble="true"
|
||||
:priceColor="appTheme.mainBg" :buyNowBackgroundColor="appTheme.mainBg" :addCartColor="appTheme.viceText" :addCartBackgroundColor="appTheme.viceBg"
|
||||
:activedStyle="{ color: appTheme.mainBg, borderColor: appTheme.mainBg, backgroundColor: activedBtnBackgroundColor }"
|
||||
@open="openSkuPopup" @close="closeSkuPopup" @buy-now="buyNow" buyNowText="立即砍价" :maxBuyNum="1" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { hex2rgba } from '@/utils/color'
|
||||
import * as TaskApi from '@/api/bargain/task'
|
||||
import GoodsSkuPopup from '@/components/goods-sku-popup'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GoodsSkuPopup
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'input'
|
||||
},
|
||||
props: {
|
||||
// true 组件显示 false 组件隐藏
|
||||
value: {
|
||||
Type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 模式 1:都显示 2:只显示购物车 3:只显示立即购买
|
||||
skuMode: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
// 砍价活动详情
|
||||
active: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 商品详情信息
|
||||
goods: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsInfo: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 规格按钮选中时的背景色
|
||||
activedBtnBackgroundColor() {
|
||||
return hex2rgba(this.appTheme.mainBg, 0.1)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const app = this
|
||||
const { goods } = app
|
||||
app.goodsInfo = {
|
||||
_id: goods.goods_id,
|
||||
name: goods.goods_name,
|
||||
goods_thumb: goods.goods_image,
|
||||
sku_list: app.getSkuList(),
|
||||
spec_list: app.getSpecList()
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 监听组件显示隐藏
|
||||
onChangeValue(val) {
|
||||
this.$emit('input', val)
|
||||
},
|
||||
|
||||
// 整理商品SKU列表
|
||||
getSkuList() {
|
||||
const app = this
|
||||
const { goods: { goods_name, goods_image, skuList } } = app
|
||||
const skuData = []
|
||||
skuList.forEach(item => {
|
||||
skuData.push({
|
||||
_id: item.id,
|
||||
goods_sku_id: item.goods_sku_id,
|
||||
goods_id: item.goods_id,
|
||||
goods_name: goods_name,
|
||||
image: item.image_url ? item.image_url : goods_image,
|
||||
price: item.goods_price * 100,
|
||||
stock: item.stock_num,
|
||||
spec_value_ids: item.spec_value_ids,
|
||||
sku_name_arr: app.getSkuNameArr(item.spec_value_ids)
|
||||
})
|
||||
})
|
||||
return skuData
|
||||
},
|
||||
|
||||
// 获取sku记录的规格值列表
|
||||
getSkuNameArr(specValueIds) {
|
||||
const app = this
|
||||
const defaultData = ['默认']
|
||||
const skuNameArr = []
|
||||
if (specValueIds) {
|
||||
specValueIds.forEach((valueId, groupIndex) => {
|
||||
const specValueName = app.getSpecValueName(valueId, groupIndex)
|
||||
skuNameArr.push(specValueName)
|
||||
})
|
||||
}
|
||||
return skuNameArr.length ? skuNameArr : defaultData
|
||||
},
|
||||
|
||||
// 获取指定的规格值名称
|
||||
getSpecValueName(valueId, groupIndex) {
|
||||
const app = this
|
||||
const { goods: { specList } } = app
|
||||
const res = specList[groupIndex].valueList.find(specValue => {
|
||||
return specValue.spec_value_id == valueId
|
||||
})
|
||||
return res.spec_value
|
||||
},
|
||||
|
||||
// 整理规格数据
|
||||
getSpecList() {
|
||||
const { goods: { specList } } = this
|
||||
const defaultData = [{ name: '默认', list: [{ name: '默认' }] }]
|
||||
const specData = []
|
||||
specList.forEach(group => {
|
||||
const children = []
|
||||
group.valueList.forEach(specValue => {
|
||||
children.push({ name: specValue.spec_value })
|
||||
})
|
||||
specData.push({
|
||||
name: group.spec_name,
|
||||
list: children
|
||||
})
|
||||
})
|
||||
return specData.length ? specData : defaultData
|
||||
},
|
||||
|
||||
// sku组件 开始-----------------------------------------------------------
|
||||
openSkuPopup() {
|
||||
// console.log("监听 - 打开sku组件")
|
||||
},
|
||||
|
||||
closeSkuPopup() {
|
||||
// console.log("监听 - 关闭sku组件")
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
buyNow(selectShop) {
|
||||
const app = this
|
||||
TaskApi.partake({
|
||||
activeId: app.active.active_id,
|
||||
goodsSkuId: selectShop.goods_sku_id
|
||||
})
|
||||
.then(result => {
|
||||
// 跳转到砍价任务详情页
|
||||
const taskId = result.data.taskId
|
||||
this.$navTo('pages/bargain/task', { taskId })
|
||||
})
|
||||
// 隐藏当前弹窗
|
||||
this.onChangeValue(false)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
413
pages/bargain/goods/index.vue
Executable file
413
pages/bargain/goods/index.vue
Executable file
@@ -0,0 +1,413 @@
|
||||
<template>
|
||||
<view v-show="!isLoading" class="container" :style="appThemeStyle">
|
||||
<!-- 商品图片轮播 -->
|
||||
<SlideImage v-if="!isLoading" :video="goods.video" :videoCover="goods.videoCover" :images="goods.goods_images" />
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<view v-if="!isLoading" class="goods-info m-top20">
|
||||
<!-- 价格、销量 -->
|
||||
<view class="info-item info-item__top dis-flex flex-x-between flex-y-end">
|
||||
<view class="block-left dis-flex flex-y-center">
|
||||
<view class="active-tag">
|
||||
<text>限时砍价</text>
|
||||
</view>
|
||||
<!-- 砍价底价 -->
|
||||
<text class="floor-price__samll">¥</text>
|
||||
<text class="floor-price">{{ active.floor_price }}</text>
|
||||
<!-- 商品原价 -->
|
||||
<text class="original-price">¥{{ goods.goods_price_min }}</text>
|
||||
</view>
|
||||
<view class="block-right dis-flex">
|
||||
<!-- 销量 -->
|
||||
<view class="goods-sales">
|
||||
<text>已砍成{{ active.active_sales }}件</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标题、分享 -->
|
||||
<view class="info-item info-item__name dis-flex flex-y-center">
|
||||
<view class="goods-name flex-box">
|
||||
<text class="twoline-hide">{{ goods.goods_name }}</text>
|
||||
</view>
|
||||
<view class="goods-share__line"></view>
|
||||
<view class="goods-share">
|
||||
<button class="share-btn dis-flex flex-dir-column" @click="onShowShareSheet()">
|
||||
<text class="share__icon iconfont icon-fenxiang"></text>
|
||||
<text class="f-24">分享</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品卖点 -->
|
||||
<view v-if="goods.selling_point" class="info-item info-item_selling-point">
|
||||
<text>{{ goods.selling_point }}</text>
|
||||
</view>
|
||||
<!-- 活动倒计时 -->
|
||||
<view v-if="active.is_end == false" class="info-item info-item_status info-item_countdown dis-flex flex-y-center">
|
||||
<text class="countdown-icon iconfont icon-naozhong"></text>
|
||||
<text>距离活动结束</text>
|
||||
<text class="m-r-10">还剩</text>
|
||||
<count-down :date="active.end_time" separator="zh" theme="text" />
|
||||
</view>
|
||||
<!-- 活动已结束 -->
|
||||
<view v-if="active.is_end == true" class="info-item info-item_status info-item_end">
|
||||
<text class="countdown-icon iconfont icon-naozhong"></text>
|
||||
<text>砍价活动已结束,下次记得早点来哦~</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 砍价玩法 -->
|
||||
<view class="bargain-rules m-top20 b-f" @click="handleShowRules()">
|
||||
<view class="item-title dis-flex">
|
||||
<view class="block-left flex-box">
|
||||
<text>砍价玩法</text>
|
||||
</view>
|
||||
<view class="block-right">
|
||||
<text class="show-more col-9">查看规则</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 砍价步骤 -->
|
||||
<view class="rule-simple dis-flex flex-x-around">
|
||||
<view class="simple-item dis-flex flex-dir-column flex-y-center">
|
||||
<view class="i-number dis-flex flex-x-center flex-y-center">
|
||||
<text class="f-30">1</text>
|
||||
</view>
|
||||
<view class="i-text f-28">点击砍价</view>
|
||||
</view>
|
||||
<view class="simple-item dis-flex flex-dir-column flex-y-center">
|
||||
<view class="i-number dis-flex flex-x-center flex-y-center">
|
||||
<text class="f-30">2</text>
|
||||
</view>
|
||||
<view class="i-text f-28">找人帮砍</view>
|
||||
</view>
|
||||
<view class="simple-item dis-flex flex-dir-column flex-y-center">
|
||||
<view class="i-number dis-flex flex-x-center flex-y-center">
|
||||
<text class="f-30">3</text>
|
||||
</view>
|
||||
<view class="i-text f-28">砍到最低</view>
|
||||
</view>
|
||||
<view class="simple-item dis-flex flex-dir-column flex-y-center">
|
||||
<view class="i-number dis-flex flex-x-center flex-y-center">
|
||||
<text class="f-30">4</text>
|
||||
</view>
|
||||
<view class="i-text f-28">优惠购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选择商品规格 -->
|
||||
<view v-if="goods.spec_type == 20" class="goods-choice m-top20 b-f" @click="onShowSkuPopup()">
|
||||
<view class="spec-list">
|
||||
<view class="flex-box">
|
||||
<text class="col-8">选择:</text>
|
||||
<text class="spec-name" v-for="(item, index) in goods.specList" :key="index">{{ item.spec_name }}</text>
|
||||
</view>
|
||||
<view class="f-26 col-9 t-r">
|
||||
<text class="iconfont icon-arrow-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品服务 -->
|
||||
<!-- <Service v-if="!isLoading" :goods-id="goodsId" /> -->
|
||||
|
||||
<!-- 商品SKU弹窗 -->
|
||||
<SkuPopup v-if="!isLoading" v-model="showSkuPopup" :skuMode="skuMode" :active="active" :goods="goods" />
|
||||
|
||||
<!-- 商品评价 -->
|
||||
<Comment v-if="!isLoading" :goods-id="goodsId" :limit="2" />
|
||||
|
||||
<!-- 商品描述 -->
|
||||
<view v-if="!isLoading" class="goods-content m-top20">
|
||||
<view class="item-title b-f">
|
||||
<text>商品描述</text>
|
||||
</view>
|
||||
<block v-if="goods.content != ''">
|
||||
<view class="goods-content__detail b-f">
|
||||
<mp-html :content="goods.content" />
|
||||
</view>
|
||||
</block>
|
||||
<empty v-else tips="亲,暂无商品描述" />
|
||||
</view>
|
||||
|
||||
<!-- 底部选项卡 -->
|
||||
<view class="footer-fixed">
|
||||
<view class="footer-container">
|
||||
<!-- 导航图标 -->
|
||||
<view class="foo-item-fast">
|
||||
<!-- 首页 -->
|
||||
<view class="fast-item fast-item--home" @click="onTargetHome">
|
||||
<view class="fast-icon">
|
||||
<text class="iconfont icon-shouye"></text>
|
||||
</view>
|
||||
<view class="fast-text">
|
||||
<text>首页</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 客服 -->
|
||||
<customer-btn v-if="isShowCustomerBtn">
|
||||
<view class="fast-item">
|
||||
<view class="fast-icon">
|
||||
<text class="iconfont icon-kefu1"></text>
|
||||
</view>
|
||||
<view class="fast-text">
|
||||
<text>客服</text>
|
||||
</view>
|
||||
</view>
|
||||
</customer-btn>
|
||||
<!-- 购物车 (客服按钮不显示时) -->
|
||||
<view v-if="!isShowCustomerBtn" class="fast-item fast-item--cart" @click="onTargetCart">
|
||||
<view v-if="cartTotal > 0" class="fast-badge fast-badge--fixed">{{ cartTotal > 99 ? '99+' : cartTotal }}
|
||||
</view>
|
||||
<view class="fast-icon">
|
||||
<text class="iconfont icon-gouwuche"></text>
|
||||
</view>
|
||||
<view class="fast-text">
|
||||
<text>购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<view class="foo-item-btn">
|
||||
<view class="btn-wrapper">
|
||||
<view v-if="active.is_start && !active.is_end" class="btn-item btn--main" @click="handleMainBtn(3)">
|
||||
<text>{{ isPartake? '继续砍价' : '立即砍价' }}</text>
|
||||
</view>
|
||||
<button v-else class="btn-item btn--gray">
|
||||
<text>{{ active.is_end ? '活动已结束' : '活动未开启' }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分享菜单 -->
|
||||
<share-sheet v-model="showShareSheet" :shareTitle="goods.goods_name" :shareImageUrl="goods.goods_image" :posterApiCall="posterApiCall" :posterApiParam="{ activeId }" />
|
||||
|
||||
<!-- 砍价规则弹窗 -->
|
||||
<u-modal v-if="!isLoading" v-model="showRules" title="砍价规则">
|
||||
<scroll-view style="height: 610rpx;" :scroll-y="true">
|
||||
<view class="pops-content">
|
||||
<text>{{ setting.rulesDesc }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</u-modal>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSceneData } from '@/core/app'
|
||||
import ShareSheet from '@/components/share-sheet'
|
||||
import CustomerBtn from '@/components/customer-btn'
|
||||
import SkuPopup from './components/SkuPopup'
|
||||
import SlideImage from '../../goods/components/SlideImage'
|
||||
import Comment from '../../goods/components/Comment'
|
||||
// import Service from '../../goods/components/Service'
|
||||
import CountDown from '@/components/countdown'
|
||||
import * as GoodsApi from '@/api/goods'
|
||||
import * as CartApi from '@/api/cart'
|
||||
import * as ActiveApi from '@/api/bargain/active'
|
||||
import SettingModel from '@/common/model/Setting'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ShareSheet,
|
||||
CustomerBtn,
|
||||
// Shortcut,
|
||||
SlideImage,
|
||||
SkuPopup,
|
||||
Comment,
|
||||
// Service,
|
||||
CountDown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 正在加载
|
||||
isLoading: true,
|
||||
// 显示/隐藏SKU弹窗
|
||||
showSkuPopup: false,
|
||||
// 模式 1:都显示 2:只显示购物车 3:只显示立即购买
|
||||
skuMode: 3,
|
||||
// 显示/隐藏分享菜单
|
||||
showShareSheet: false,
|
||||
// 显示砍价规则
|
||||
showRules: false,
|
||||
// 获取商品海报图api方法
|
||||
posterApiCall: ActiveApi.poster,
|
||||
// 当前活动ID
|
||||
activeId: null,
|
||||
// 当前商品ID
|
||||
goodsId: null,
|
||||
// 活动详情
|
||||
active: {},
|
||||
// 商品详情
|
||||
goods: {},
|
||||
// 砍价设置
|
||||
setting: null,
|
||||
// 标记当前用户是否正在参与
|
||||
isPartake: null,
|
||||
// 砍价任务ID (当前用户参与的话才有值)
|
||||
taskId: null,
|
||||
// 购物车总数量
|
||||
cartTotal: 0,
|
||||
// 是否显示在线客服按钮
|
||||
isShowCustomerBtn: false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
async onLoad(options) {
|
||||
// 记录query参数
|
||||
this.onRecordQuery(options)
|
||||
// 加载页面数据
|
||||
this.onRefreshPage()
|
||||
// 是否显示在线客服按钮
|
||||
this.isShowCustomerBtn = await SettingModel.isShowCustomerBtn()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 记录query参数
|
||||
onRecordQuery(query) {
|
||||
const scene = getSceneData(query)
|
||||
this.activeId = query.activeId ? parseInt(query.activeId) : parseInt(scene.aid)
|
||||
this.goodsId = query.goodsId ? parseInt(query.goodsId) : parseInt(scene.gid)
|
||||
},
|
||||
|
||||
// 刷新页面数据
|
||||
onRefreshPage() {
|
||||
const app = this
|
||||
app.isLoading = true
|
||||
Promise.all([app.getActiveDetail(), app.getGoodsDetail(), app.getCartTotal()])
|
||||
.then(() => app.isLoading = false)
|
||||
},
|
||||
|
||||
// 获取砍价活动详情
|
||||
getActiveDetail() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
ActiveApi.detail(app.activeId)
|
||||
.then(result => {
|
||||
app.active = result.data.active
|
||||
app.setting = result.data.setting
|
||||
app.isPartake = result.data.isPartake
|
||||
app.taskId = result.data.taskId
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取商品信息
|
||||
getGoodsDetail() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
GoodsApi.detail(app.goodsId, false)
|
||||
.then(result => {
|
||||
app.goods = result.data.detail
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取购物车总数量
|
||||
getCartTotal() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
CartApi.total()
|
||||
.then(result => {
|
||||
app.cartTotal = result.data.cartTotal
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 显示/隐藏SKU弹窗
|
||||
*/
|
||||
onShowSkuPopup() {
|
||||
this.showSkuPopup = !this.showSkuPopup
|
||||
},
|
||||
|
||||
// 显示隐藏分享菜单
|
||||
onShowShareSheet() {
|
||||
this.showShareSheet = !this.showShareSheet
|
||||
},
|
||||
|
||||
// 显示砍价规则
|
||||
handleShowRules() {
|
||||
this.showRules = true
|
||||
},
|
||||
|
||||
// 跳转到首页
|
||||
onTargetHome(e) {
|
||||
this.$navTo('pages/index/index')
|
||||
},
|
||||
|
||||
// 跳转到购物车页
|
||||
onTargetCart() {
|
||||
this.$navTo('pages/cart/index')
|
||||
},
|
||||
|
||||
// 点击主按钮
|
||||
handleMainBtn() {
|
||||
const app = this
|
||||
// 发起新的砍价任务
|
||||
if (!app.isPartake) {
|
||||
return app.onShowSkuPopup()
|
||||
}
|
||||
// 已发起砍价则跳转到砍价任务详情页
|
||||
app.$navTo('pages/bargain/task', { taskId: app.taskId })
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享当前页面
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
// 构建页面参数
|
||||
const app = this
|
||||
const params = app.$getShareUrlParams({
|
||||
activeId: app.activeId,
|
||||
goodsId: app.goodsId
|
||||
})
|
||||
return {
|
||||
title: app.goods.goods_name,
|
||||
path: `/pages/bargain/goods/index?${params}`
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享到朋友圈
|
||||
* 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta)
|
||||
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
|
||||
*/
|
||||
onShareTimeline() {
|
||||
// 构建页面参数
|
||||
const app = this
|
||||
const params = app.$getShareUrlParams({
|
||||
activeId: app.activeId,
|
||||
goodsId: app.goodsId
|
||||
})
|
||||
return {
|
||||
title: app.goods.goods_name,
|
||||
path: `/pages/bargain/goods/index?${params}`
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
</style>
|
||||
298
pages/bargain/goods/style.scss
Executable file
298
pages/bargain/goods/style.scss
Executable file
@@ -0,0 +1,298 @@
|
||||
.container {
|
||||
// 设置ios刘海屏底部横线安全区域
|
||||
// 110 - 18 + 4
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 98rpx + 6rpx);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 98rpx + 6rpx);
|
||||
}
|
||||
|
||||
/* 商品信息 */
|
||||
|
||||
.goods-info {
|
||||
background: #fff;
|
||||
padding: 25rpx 30rpx;
|
||||
}
|
||||
|
||||
.info-item__top {
|
||||
min-height: 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.info-item__top .active-tag {
|
||||
color: #fff;
|
||||
background: $main-bg;
|
||||
padding: 4rpx 10rpx;
|
||||
border-radius: 15rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.floor-price__samll {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
color: $main-bg;
|
||||
margin-bottom: -10rpx;
|
||||
}
|
||||
|
||||
/* 商品价 */
|
||||
|
||||
.floor-price {
|
||||
color: $main-bg;
|
||||
margin-right: 15rpx;
|
||||
font-size: 42rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.original-price {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
text-decoration: line-through;
|
||||
color: #959595;
|
||||
margin-bottom: -6rpx;
|
||||
}
|
||||
|
||||
.goods-sales {
|
||||
font-size: 24rpx;
|
||||
color: #959595;
|
||||
}
|
||||
|
||||
.info-item__name .goods-name {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
/* 商品分享 */
|
||||
|
||||
.goods-share__line {
|
||||
border-left: 1rpx solid #f4f4f4;
|
||||
height: 60rpx;
|
||||
margin: 0 30rpx;
|
||||
}
|
||||
|
||||
.goods-share .share-btn {
|
||||
line-height: normal;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
font-size: 8pt;
|
||||
border: none;
|
||||
color: #191919;
|
||||
}
|
||||
|
||||
.goods-share .share-btn::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.goods-share .share__icon {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
/* 商品卖点 */
|
||||
|
||||
.info-item_selling-point {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
// 选择商品规格
|
||||
.goods-choice {
|
||||
padding: 26rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.spec-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.spec-name {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 商品详情 */
|
||||
|
||||
.goods-content .item-title {
|
||||
padding: 26rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 底部操作栏 */
|
||||
|
||||
.footer-fixed {
|
||||
position: fixed;
|
||||
bottom: var(--window-bottom);
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
z-index: 11;
|
||||
box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
|
||||
background: #fff;
|
||||
|
||||
// 设置ios刘海屏底部横线安全区域
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 98rpx;
|
||||
}
|
||||
|
||||
// 快捷菜单
|
||||
.foo-item-fast {
|
||||
box-sizing: border-box;
|
||||
width: 256rpx;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.fast-item {
|
||||
position: relative;
|
||||
padding: 4rpx 10rpx;
|
||||
line-height: 1;
|
||||
// text-align: center;
|
||||
|
||||
.fast-icon {
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
&--home {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
&--cart {
|
||||
.fast-icon { padding-left: 3px; }
|
||||
}
|
||||
|
||||
// 角标
|
||||
.fast-badge {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
min-width: 16px;
|
||||
padding: 0 3px;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
font-family: -apple-system-font, Helvetica Neue, Arial, sans-serif;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
background-color: #ee0a24;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.fast-badge--fixed {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
transform-origin: 100%
|
||||
}
|
||||
|
||||
.fast-icon {
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
.fast-text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 操作按钮
|
||||
.foo-item-btn {
|
||||
flex: 1;
|
||||
|
||||
.btn-wrapper {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// 立即砍价
|
||||
.btn-item {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 0;
|
||||
&.btn--main {
|
||||
background: linear-gradient(to right, $main-bg, $main-bg2);
|
||||
color: $main-text;
|
||||
}
|
||||
&.btn--gray {
|
||||
background-color: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 活动状态
|
||||
.info-item_status {
|
||||
margin-top: 20rpx;
|
||||
padding: 15rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.info-item_status .countdown-icon {
|
||||
font-size: 28rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
// 活动倒计时
|
||||
.info-item_countdown {
|
||||
background: #f0f9ff;
|
||||
color: #8f8f8f;
|
||||
}
|
||||
|
||||
.info-item_countdown .countdown-icon {
|
||||
color: #1397d8;
|
||||
}
|
||||
|
||||
// 活动已结束
|
||||
.info-item_end {
|
||||
background: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
// 砍价玩法
|
||||
.bargain-rules {
|
||||
padding: 20rpx 0;
|
||||
font-size: 29rpx;
|
||||
|
||||
.item-title {
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.rule-simple {
|
||||
margin-top: 35rpx;
|
||||
color: #737373;
|
||||
}
|
||||
|
||||
.i-number {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 15rpx;
|
||||
border: 1rpx dashed #c0c0c0;
|
||||
}
|
||||
}
|
||||
|
||||
// 砍价规则(弹窗)
|
||||
.pops-content {
|
||||
padding: 30rpx 48rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: left;
|
||||
color: #606266;
|
||||
min-height: 320rpx;
|
||||
max-height: 640rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
479
pages/bargain/index.vue
Executable file
479
pages/bargain/index.vue
Executable file
@@ -0,0 +1,479 @@
|
||||
<template>
|
||||
<view class="container" :style="appThemeStyle">
|
||||
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ use: false }" :up="upOption" @up="upCallback">
|
||||
|
||||
<!-- 砍价会场 -->
|
||||
<view v-if="curTab == 0" class="bargain-hall">
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods-item" v-for="(item, index) in activeList.data" :key="index">
|
||||
<view class="goods-item--container dis-flex" @click="onTargetActive(item)">
|
||||
<!-- 商品图片 -->
|
||||
<view class="goods-image">
|
||||
<image class="image" :src="item.goods.goods_image"></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<!-- 商品名称 -->
|
||||
<view class="goods-name">
|
||||
<text class="twoline-hide">{{ item.goods.goods_name }}</text>
|
||||
</view>
|
||||
<!-- 参与的用户头像 -->
|
||||
<view v-if="item.helpsCount > 0" class="peoples dis-flex">
|
||||
<view class="user-list dis-flex">
|
||||
<view class="user-item-avatar" v-for="(help, hIdx) in item.helpList" :key="hIdx">
|
||||
<avatar-image :url="help.user.avatar_url" :width="36" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="people__text">
|
||||
<text>{{ item.helpsCount }}人正在砍价</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品原价 -->
|
||||
<view class="goods-price">
|
||||
<text>¥{{ item.goods.goods_price_min }}</text>
|
||||
</view>
|
||||
<!-- 砍价低价 -->
|
||||
<view class="floor-price">
|
||||
<text class="small">最低¥</text>
|
||||
<text class="big">{{ item.floor_price }}</text>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<view class="opt-touch">
|
||||
<view class="touch-btn">
|
||||
<text>立即参加</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 我的砍价 -->
|
||||
<view v-if="curTab == 1" class="bargain-hall">
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods-item" v-for="(item, index) in myList.data" :key="index">
|
||||
<view class="goods-item--container dis-flex" @click="onTargetTask(item.task_id)">
|
||||
<!-- 商品图片 -->
|
||||
<view class="goods-image">
|
||||
<image class="image" :src="item.goods.goods_image"></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<!-- 商品名称 -->
|
||||
<view class="goods-name">
|
||||
<text class="twoline-hide">{{ item.goods.goods_name }}</text>
|
||||
</view>
|
||||
<!-- 砍价进度 -->
|
||||
<view class="task-rate">
|
||||
<block v-if="item.status == true">
|
||||
<text>已砍</text>
|
||||
<text class="col-m">{{ item.cut_money }}</text>
|
||||
<text>元,</text>
|
||||
<text>只差</text>
|
||||
<text class="col-m">{{ item.surplus_money }}</text>
|
||||
<text>元</text>
|
||||
</block>
|
||||
<block v-if="item.is_floor">
|
||||
<text>已砍至最低</text>
|
||||
<text class="col-m">{{ item.floor_price }}</text>
|
||||
<text>元</text>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 任务状态 -->
|
||||
<view class="task-status dis-flex flex-y-center">
|
||||
<!-- 倒计时 -->
|
||||
<view v-if="item.status == true" class="count-down dis-flex flex-y-center">
|
||||
<text class="m-r-6">剩余</text>
|
||||
<count-down :date="item.end_time" separator="colon" theme="custom" />
|
||||
</view>
|
||||
<view v-if="item.status == false" class="task-status__text">
|
||||
<text class="col-m">{{ item.is_buy ? '砍价成功' : '已结束' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<view v-if="item.status == true" class="opt-touch">
|
||||
<view class="touch-btn">
|
||||
<text>继续砍价</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部选项卡 -->
|
||||
<view class="footer-fixed">
|
||||
<view class="footer-container">
|
||||
<!-- 砍价会场 -->
|
||||
<view class="tabbar-item flex-box" :class="{ active: curTab == 0 }">
|
||||
<view class="tabbar-item-content dis-flex flex-x-center flex-y-center" @click="onChangeTab(0)">
|
||||
<view class="tabbar-item-icon">
|
||||
<text class="iconfont icon-shangcheng"></text>
|
||||
</view>
|
||||
<view class="tabbar-item-name">
|
||||
<text>砍价会场</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分割线 -->
|
||||
<view class="tabbar-item__divider">
|
||||
<view class="divider-line"></view>
|
||||
</view>
|
||||
<!-- 我的砍价 -->
|
||||
<view class="tabbar-item flex-box" :class="{ active: curTab == 1 }">
|
||||
<view class="tabbar-item-content dis-flex flex-x-center flex-y-center" @click="onChangeTab(1)">
|
||||
<view class="tabbar-item-icon">
|
||||
<text class="iconfont icon-sy-yh"></text>
|
||||
</view>
|
||||
<view class="tabbar-item-name">
|
||||
<text>我的砍价</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AvatarImage from '@/components/avatar-image'
|
||||
import CountDown from '@/components/countdown'
|
||||
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
|
||||
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
|
||||
import { getEmptyPaginateObj, getMoreListData } from '@/core/app'
|
||||
import * as ActiveApi from '@/api/bargain/active'
|
||||
import * as TaskApi from '@/api/bargain/task'
|
||||
|
||||
const pageSize = 15
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MescrollBody,
|
||||
AvatarImage,
|
||||
CountDown
|
||||
},
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
// 是否正在加载中
|
||||
isLoading: true,
|
||||
// 当前tab索引
|
||||
curTab: 0,
|
||||
// 砍价会场商品列表
|
||||
activeList: getEmptyPaginateObj(),
|
||||
// 我的砍价列表
|
||||
myList: getEmptyPaginateObj(),
|
||||
// 上拉加载配置
|
||||
upOption: {
|
||||
// 首次自动执行
|
||||
auto: true,
|
||||
// 每页数据的数量; 默认10
|
||||
page: { size: pageSize },
|
||||
// 数量要大于3条才显示无更多数据
|
||||
noMoreSize: 3,
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
curTab(val) {
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({ title: val == 0 ? '砍价会场' : '我的砍价' })
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
// 设置当前tab索引
|
||||
if (options.tab) {
|
||||
this.curTab = options.tab
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 上拉加载的回调 (页面初始化时也会执行一次)
|
||||
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
|
||||
* @param {Object} page
|
||||
*/
|
||||
upCallback(page) {
|
||||
const app = this
|
||||
// 设置列表数据
|
||||
app.getListData(page.num)
|
||||
.then(list => {
|
||||
const curPageLen = list.data.length
|
||||
const totalSize = list.data.total
|
||||
app.mescroll.endBySize(curPageLen, totalSize)
|
||||
})
|
||||
.catch(() => app.mescroll.endErr())
|
||||
},
|
||||
|
||||
// 获取列表数据(根据当前选项卡判断调用的方法)
|
||||
getListData(pageNo) {
|
||||
const apiFuc = {
|
||||
0: this.getActiveList,
|
||||
1: this.getMyList
|
||||
}
|
||||
return apiFuc[this.curTab](pageNo)
|
||||
},
|
||||
|
||||
// 获取砍价活动列表
|
||||
getActiveList(pageNo) {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
ActiveApi.list({ page: pageNo }, { load: false })
|
||||
.then(result => {
|
||||
// 合并新数据
|
||||
const newList = result.data.list
|
||||
app.activeList.data = getMoreListData(newList, app.activeList, pageNo)
|
||||
resolve(newList)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取我的砍价列表
|
||||
getMyList(pageNo) {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
TaskApi.list({ page: pageNo }, { load: false })
|
||||
.then(result => {
|
||||
// 合并新数据
|
||||
const newList = result.data.list
|
||||
app.myList.data = getMoreListData(newList, app.myList, pageNo)
|
||||
resolve(newList)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 切换当前选项卡
|
||||
onChangeTab(key = 0) {
|
||||
const app = this
|
||||
// 记录选项卡索引
|
||||
app.curTab = key
|
||||
// 刷新列表数据
|
||||
app.activeList = getEmptyPaginateObj()
|
||||
app.myList = getEmptyPaginateObj()
|
||||
app.mescroll.resetUpScroll()
|
||||
},
|
||||
|
||||
// 跳转到砍价商品详情页
|
||||
onTargetActive(item) {
|
||||
this.$navTo('pages/bargain/goods/index', { activeId: item.active_id, goodsId: item.goods_id })
|
||||
},
|
||||
|
||||
// 跳转到砍价任务详情
|
||||
onTargetTask(taskId) {
|
||||
this.$navTo('pages/bargain/task', { taskId })
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享当前页面
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
// 构建页面参数
|
||||
const params = this.$getShareUrlParams()
|
||||
return {
|
||||
title: '砍价专区',
|
||||
path: `/pages/bargain/index?${params}`
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享到朋友圈
|
||||
* 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta)
|
||||
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
|
||||
*/
|
||||
onShareTimeline() {
|
||||
// 构建页面参数
|
||||
const params = this.$getShareUrlParams()
|
||||
return {
|
||||
title: '砍价专区',
|
||||
path: `/pages/bargain/index?${params}`
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
// 设置ios刘海屏底部横线安全区域
|
||||
// 110 - 18 + 4
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 96rpx);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx);
|
||||
}
|
||||
|
||||
.bargain-hall {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
// 砍价商品
|
||||
.goods-item {
|
||||
margin-bottom: 20rpx;
|
||||
background: #fff;
|
||||
padding: 20rpx 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.goods-image {
|
||||
.image {
|
||||
display: block;
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-info {
|
||||
width: 498rpx;
|
||||
padding-top: 8rpx;
|
||||
margin-left: 15rpx;
|
||||
position: relative;
|
||||
|
||||
.goods-name {
|
||||
font-size: 28rpx;
|
||||
min-height: 60rpx;
|
||||
}
|
||||
|
||||
// 正在参与的用户
|
||||
.peoples {
|
||||
margin-top: 15rpx;
|
||||
|
||||
.user-list {
|
||||
margin-right: 10rpx;
|
||||
|
||||
.user-item-avatar {
|
||||
margin-left: -8rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.people__text {
|
||||
font-size: 24rpx;
|
||||
color: #818181;
|
||||
}
|
||||
}
|
||||
|
||||
// 商品原价
|
||||
.goods-price {
|
||||
margin-top: 15rpx;
|
||||
color: #818181;
|
||||
font-size: 25rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
// 砍价底价
|
||||
.floor-price {
|
||||
color: $main-bg;
|
||||
|
||||
.small {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.big {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 砍价进度
|
||||
.task-rate {
|
||||
font-size: 25rpx;
|
||||
color: #a4a4a4;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 我的砍价 */
|
||||
// 砍价状态
|
||||
.task-status {
|
||||
margin-top: 32rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
|
||||
.task-status__text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
// 倒计时
|
||||
.count-down {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
// 立即参加按钮
|
||||
.opt-touch {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 10rpx;
|
||||
}
|
||||
|
||||
.touch-btn {
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
background: #d3a975;
|
||||
border-radius: 30rpx;
|
||||
padding: 10rpx 28rpx;
|
||||
}
|
||||
|
||||
// 底部选项卡
|
||||
.footer-fixed {
|
||||
position: fixed;
|
||||
bottom: var(--window-bottom);
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 11;
|
||||
box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
|
||||
background: #fff;
|
||||
|
||||
// 设置ios刘海屏底部横线安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 96rpx;
|
||||
}
|
||||
|
||||
.tabbar-item {
|
||||
font-size: 30rpx;
|
||||
// height: 42rpx;
|
||||
|
||||
&.active {
|
||||
.tabbar-item-content {
|
||||
color: $main-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.tabbar-item-icon {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 分割线
|
||||
.tabbar-item__divider {
|
||||
padding: 22rpx 0;
|
||||
}
|
||||
|
||||
.divider-line {
|
||||
width: 1rpx;
|
||||
height: 62rpx;
|
||||
background: #ddd;
|
||||
}
|
||||
</style>
|
||||
838
pages/bargain/task.vue
Executable file
838
pages/bargain/task.vue
Executable file
@@ -0,0 +1,838 @@
|
||||
<template>
|
||||
<view v-if="!isLoading" class="container">
|
||||
|
||||
<!-- 顶部操作栏 -->
|
||||
<view class="header dis-flex flex-x-between">
|
||||
<view class="item-touch" @click="$navTo('pages/index/index')">
|
||||
<text>返回首页</text>
|
||||
</view>
|
||||
<view class="item-touch" @click="handleShowRules()">
|
||||
<text>玩法详情</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<!-- 砍价信息 -->
|
||||
<view class="infos-wrap">
|
||||
<view class="infos-top">
|
||||
<view class="infos-img">
|
||||
<avatar-image :url="task.user.avatar_url" :width="104" />
|
||||
</view>
|
||||
<view class="infos-name">
|
||||
<text>{{ task.user.nick_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="infos-mask">
|
||||
<view class="infos-prompt" v-if="active.prompt_words">
|
||||
<text>{{ active.prompt_words }}</text>
|
||||
</view>
|
||||
<!-- 商品信息 -->
|
||||
<view class="infos-item" @click="$navTo('pages/bargain/goods/index', { activeId, goodsId: goods.goods_id })">
|
||||
<view class="infos-item-img">
|
||||
<image class="image" :src="goodsSkuInfo.goods_image ? goodsSkuInfo.goods_image : goods.goods_image"></image>
|
||||
</view>
|
||||
<view class="infos-item-info">
|
||||
<view class="infos-item-name">
|
||||
<text class="twoline-hide">{{ goods.goods_name }}</text>
|
||||
</view>
|
||||
<view class="infos-item-stock">
|
||||
<view class="stock-widget">
|
||||
<text>仅剩</text>
|
||||
<text class="stock-num">{{ goodsSkuInfo.stock_num }}</text>
|
||||
<text>件</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="infos-item-price dis-flex flex-y-end">
|
||||
<text class="price1 col-m">底价¥</text>
|
||||
<text class="price2 col-m">{{ task.floor_price }}</text>
|
||||
<text class="price3">¥{{ task.goods_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<view class="connect">
|
||||
<view class="connect-ring bgf-ring--left">
|
||||
<text class="line"></text>
|
||||
</view>
|
||||
<view class="connect-ring bgf-ring--right">
|
||||
<text class="line"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 砍价进度 -->
|
||||
<view class="bargain-wrap">
|
||||
<!-- 已砍数目 -->
|
||||
<view class="bargain-info">
|
||||
<view v-if="task.status" class="bargain-ing">
|
||||
<block v-if="!task.is_floor">
|
||||
<text>已砍</text>
|
||||
<text class="focal col-m">{{ task.cut_money }}</text>
|
||||
<text>元,还差</text>
|
||||
<text class="focal col-m">{{ task.surplus_money }}</text>
|
||||
<text>元</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text>已砍至最低</text>
|
||||
<text class="focal col-m">{{ task.floor_price }}</text>
|
||||
<text>元,砍价成功!</text>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else class="bargain-ing">
|
||||
<text class="col-9">该砍价任务已结束~</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 砍价进度条 -->
|
||||
<view class="bgn__process m-top30">
|
||||
<view class="bgn__process-bottom">
|
||||
<view class="bgn__process-process process--ani" :style="{ width: `${task.bargain_rate}%` }"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<view class="btn-container m-top30 dis-flex flex-x-center">
|
||||
<!-- 立即购买 -->
|
||||
<view v-if="showBuyBtn" class="btn-item btn-item__buy" :class="{ complete: task.is_floor }" @click="handleBuyNow()">
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
<!-- 分享给朋友 -->
|
||||
<button v-if="showShareBtn" open-type="share" class="btn-normal" @click="handleShareBtn()">
|
||||
<view class="btn-item btn-item__main">
|
||||
<text>邀请好友砍价</text>
|
||||
</view>
|
||||
</button>
|
||||
<!-- 砍一刀操作 -->
|
||||
<view v-if="showCatBtn" class="btn-item btn-item__main btn-item-long" @click="handleHelpCut()">
|
||||
<text>帮TA砍一刀</text>
|
||||
</view>
|
||||
<!-- 查看其他砍价活动 -->
|
||||
<view v-if="showOtherBtn" class="btn-item btn-item__main btn-item-long" @click="$navTo('pages/bargain/index')">
|
||||
<text>查看其他砍价活动</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 到期时间 -->
|
||||
<view class="bargain-p" v-if="task.status">
|
||||
<view class="bargain-people dis-flex flex-x-center flex-y-center">
|
||||
<text>活动还剩</text>
|
||||
<count-down :date="active.end_time" separator="zh" theme="text" />
|
||||
<text>结束,快来砍价吧~</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 好友助力榜 -->
|
||||
<view class="records-container" v-if="helpList.length">
|
||||
<view class="records">
|
||||
<view class="records-back"></view>
|
||||
<view class="records-content">
|
||||
<view class="records-h2">
|
||||
<text>好友助力榜</text>
|
||||
</view>
|
||||
<view class="friend-help">
|
||||
<view class="records-item" v-for="(help, idx) in helpList" :key="idx">
|
||||
<view class="records-left">
|
||||
<avatar-image :url="help.user.avatar_url" :width="70" />
|
||||
<text class="nick-name">{{ help.user.nick_name }}</text>
|
||||
</view>
|
||||
<view class="records-right">
|
||||
<text class="bold m-r-6">帮砍了</text>
|
||||
<text class="red">¥{{ help.cut_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 砍价规则弹窗 -->
|
||||
<u-modal v-if="!isLoading" v-model="showRules" title="砍价规则">
|
||||
<scroll-view style="height: 610rpx;" :scroll-y="true">
|
||||
<view class="pops-content">
|
||||
<text>{{ setting.rulesDesc }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</u-modal>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCurrentPage, buildUrL } from '@/core/app'
|
||||
import AvatarImage from '@/components/avatar-image'
|
||||
import CountDown from '@/components/countdown'
|
||||
import SettingModel from '@/common/model/Setting'
|
||||
import * as GoodsApi from '@/api/goods'
|
||||
import * as TaskApi from '@/api/bargain/task'
|
||||
import * as ActiveApi from '@/api/bargain/active'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AvatarImage,
|
||||
CountDown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否正在加载中
|
||||
isLoading: true,
|
||||
|
||||
taskId: undefined, // 砍价任务ID
|
||||
activeId: undefined, // 砍价活动ID
|
||||
|
||||
task: {}, // 砍价任务详情
|
||||
active: {}, // 活动详情
|
||||
goods: {}, // 商品详情
|
||||
goodsSkuInfo: {}, // 商品SKU信息
|
||||
helpList: [], // 好友助力榜
|
||||
isCreater: false, // 是否为当前砍价任务的发起人
|
||||
isCut: false, // 当前是否已砍
|
||||
setting: {}, // 砍价规则
|
||||
|
||||
showRules: false, // 显示砍价规则
|
||||
disabled: false, // 按钮禁用状态
|
||||
|
||||
showBuyBtn: false, // 立即购买
|
||||
showShareBtn: false, // 邀请好友砍价
|
||||
showCatBtn: false, // 帮TA砍一刀
|
||||
showOtherBtn: false, // 查看其他砍价活动
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.taskId = options.taskId
|
||||
// 刷新页面数据
|
||||
this.onRefreshPage()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 刷新页面数据
|
||||
onRefreshPage() {
|
||||
const app = this
|
||||
app.isLoading = true
|
||||
// 获取砍价任务详情
|
||||
app.getTaskDetail()
|
||||
.then(result => {
|
||||
Promise.all([
|
||||
app.getActiveDetail(),
|
||||
app.getGoodsBasic(),
|
||||
app.getGoodsSku(),
|
||||
app.getHelpList()
|
||||
])
|
||||
.then(() => app.initShowBtn())
|
||||
.finally(() => app.isLoading = false)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取砍价任务详情
|
||||
getTaskDetail() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
TaskApi.detail(app.taskId)
|
||||
.then(result => {
|
||||
app.task = result.data.taskInfo
|
||||
app.activeId = app.task.active_id
|
||||
app.isCreater = result.data.isCreater
|
||||
app.isCut = result.data.isCut
|
||||
app.setting = result.data.setting
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取砍价活动详情
|
||||
getActiveDetail() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
ActiveApi.detail(app.activeId)
|
||||
.then(result => {
|
||||
app.active = result.data.active
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取商品信息
|
||||
getGoodsBasic() {
|
||||
const app = this
|
||||
const goodsId = app.task.goods_id
|
||||
return new Promise((resolve, reject) => {
|
||||
GoodsApi.basic(goodsId, false)
|
||||
.then(result => {
|
||||
app.goods = result.data.detail
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取商品SKU信息
|
||||
getGoodsSku() {
|
||||
const app = this
|
||||
const goodsId = app.task.goods_id
|
||||
const goodsSkuId = app.task.goods_sku_id
|
||||
return new Promise((resolve, reject) => {
|
||||
GoodsApi.skuInfo(goodsId, goodsSkuId)
|
||||
.then(result => {
|
||||
app.goodsSkuInfo = result.data.skuInfo
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 获取砍价活动详情
|
||||
getHelpList() {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
TaskApi.helpList(app.taskId)
|
||||
.then(result => {
|
||||
app.helpList = result.data.list
|
||||
resolve(result)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
},
|
||||
|
||||
// 初始化:显示操作按钮
|
||||
initShowBtn() {
|
||||
const app = this
|
||||
// 立即购买
|
||||
const showBuyBtn = app.isCreater && !app.task.is_buy && app.task.status && (!app.active.is_floor_buy ||
|
||||
app.task.is_floor)
|
||||
// 帮砍一刀
|
||||
const showCatBtn = !app.isCreater && !app.isCut && !app.task.is_floor && app.task.status
|
||||
// 邀请好友砍价
|
||||
const showShareBtn = !showCatBtn && !app.task.is_floor && app.task.status
|
||||
// 查看其他砍价活动
|
||||
const showOtherBtn = !showBuyBtn && !showShareBtn && !showCatBtn
|
||||
app.showBuyBtn = showBuyBtn
|
||||
app.showCatBtn = showCatBtn
|
||||
app.showShareBtn = showShareBtn
|
||||
app.showOtherBtn = showOtherBtn
|
||||
},
|
||||
|
||||
// 显示砍价规则
|
||||
handleShowRules() {
|
||||
this.showRules = true
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
handleBuyNow() {
|
||||
// 跳转到结算页
|
||||
const app = this
|
||||
app.$navTo('pages/checkout/index', {
|
||||
mode: 'bargain',
|
||||
taskId: app.taskId
|
||||
})
|
||||
},
|
||||
|
||||
// 帮砍一刀
|
||||
handleHelpCut() {
|
||||
const app = this
|
||||
app.disabled = true
|
||||
TaskApi.helpCut(app.taskId)
|
||||
.then(result => {
|
||||
app.$toast(result.message)
|
||||
setTimeout(() => app.onRefreshPage(), 1800)
|
||||
})
|
||||
.finally(() => app.disabled = false)
|
||||
},
|
||||
|
||||
// 点击分享按钮
|
||||
handleShareBtn() {
|
||||
// #ifndef MP
|
||||
this.handleCopyLink()
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 复制当前页面链接
|
||||
handleCopyLink() {
|
||||
const app = this
|
||||
app.getShareUrl().then(shareUrl => {
|
||||
// 复制到剪贴板
|
||||
uni.setClipboardData({
|
||||
data: shareUrl,
|
||||
success: () => app.$toast('复制链接成功,快去发送给朋友吧'),
|
||||
fail: err => app.$toast('复制失败')
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 获取分享链接 (H5外链)
|
||||
getShareUrl() {
|
||||
const { path, query } = getCurrentPage()
|
||||
return new Promise((resolve, reject) => {
|
||||
// 获取h5站点地址
|
||||
SettingModel.h5Url(true)
|
||||
.then(baseUrl => {
|
||||
// 生成完整的分享链接
|
||||
const shareUrl = buildUrL(baseUrl, path, query)
|
||||
resolve(shareUrl)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享当前页面
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
// 构建页面参数
|
||||
const app = this
|
||||
const params = app.$getShareUrlParams({ taskId: app.taskId })
|
||||
return {
|
||||
title: app.active.share_title,
|
||||
path: `/pages/bargain/task?${params}`
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享到朋友圈
|
||||
* 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta)
|
||||
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
|
||||
*/
|
||||
onShareTimeline() {
|
||||
// 构建页面参数
|
||||
const app = this
|
||||
const params = app.$getShareUrlParams({ taskId: app.taskId })
|
||||
return {
|
||||
title: app.active.share_title,
|
||||
path: `/pages/bargain/task?${params}`
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
background: url('https://si.geilicdn.com/img-310900000167962321710a026860-unadjust_750_686.png') top no-repeat,
|
||||
linear-gradient(90deg, #fea044, #f9565d 63%, #e63378);
|
||||
background-size: 100% auto;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
/* 头部区域 */
|
||||
.header {
|
||||
padding: 30rpx 30rpx;
|
||||
|
||||
.item-touch {
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
padding: 7rpx 20rpx;
|
||||
background: rgba(0, 0, 0, 0.17);
|
||||
border-radius: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容区域 */
|
||||
.content {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding: 10rpx 30rpx 60rpx 30rpx;
|
||||
}
|
||||
|
||||
/* 砍价信息 */
|
||||
.infos-wrap {
|
||||
background: #fff;
|
||||
box-shadow: 0 4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
|
||||
padding: 0 30rpx 40rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.infos-top {
|
||||
position: relative;
|
||||
top: -42rpx;
|
||||
margin-bottom: -22rpx;
|
||||
}
|
||||
|
||||
.infos-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
padding: 8rpx;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.infos-name {
|
||||
margin: 8rpx auto 0;
|
||||
width: 80%;
|
||||
font-size: 26rpx;
|
||||
color: #9a9a9a;
|
||||
text-align: center;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.infos-prompt {
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #222;
|
||||
line-height: 48rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.infos-item {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.infos-item-img {
|
||||
flex: none;
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
|
||||
.image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.infos-item-info {
|
||||
margin-left: 25rpx;
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.infos-item-name {
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
line-height: 40rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.infos-item-stock {
|
||||
.stock-widget {
|
||||
display: inline-block;
|
||||
min-width: 100rpx;
|
||||
padding: 0 20rpx;
|
||||
background-image: linear-gradient(-90deg, #fe9c3f, #fb6253 99%);
|
||||
border-radius: 40rpx;
|
||||
height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
line-height: 40rpx;
|
||||
margin-top: 6rpx;
|
||||
|
||||
.stock-num {
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.infos-item-price {
|
||||
font-size: 0;
|
||||
margin-top: 8rpx;
|
||||
|
||||
.price1 {
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.price2 {
|
||||
margin-left: 4rpx;
|
||||
font-size: 36rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.price3 {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #9a9a9a;
|
||||
line-height: 32rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
/* 分割线 */
|
||||
.connect {
|
||||
position: relative;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.connect-ring {
|
||||
position: absolute;
|
||||
top: -28rpx;
|
||||
height: 76rpx;
|
||||
width: 20rpx;
|
||||
padding: 8rpx 6rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:after,
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
left: 0;
|
||||
height: 20rpx;
|
||||
width: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
z-index: 8;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
&.bgf-ring--left {
|
||||
left: 20rpx;
|
||||
|
||||
&:before {
|
||||
top: 0;
|
||||
background: #f4914e;
|
||||
}
|
||||
|
||||
&:after {
|
||||
bottom: 0;
|
||||
background: #f4914e;
|
||||
}
|
||||
}
|
||||
|
||||
&.bgf-ring--right {
|
||||
right: 20rpx;
|
||||
|
||||
&:before {
|
||||
top: 0;
|
||||
background: #e03e71;
|
||||
}
|
||||
|
||||
&:after {
|
||||
bottom: 0;
|
||||
background: #e03e71;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 砍价进度 */
|
||||
.bargain-wrap {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
padding: 40rpx 30rpx 30rpx;
|
||||
box-shadow: 0 4rpx 40rpx 0 rgba(144, 52, 52, 0.1);
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.bargain-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
line-height: 40rpx;
|
||||
|
||||
.focal {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bargain-p {
|
||||
margin-top: 40rpx;
|
||||
min-height: 32rpx;
|
||||
}
|
||||
|
||||
.bargain-people {
|
||||
font-size: 24rpx;
|
||||
color: #9a9a9a;
|
||||
text-align: center;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
/* 进度条 */
|
||||
.bgn__process {
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.bgn__process-bottom {
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
background-image: linear-gradient(0deg, #f0f2f7, #e8ebf3);
|
||||
}
|
||||
|
||||
.bgn__process-bottom,
|
||||
.bgn__process-process {
|
||||
position: relative;
|
||||
height: 30rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.bgn__process-process {
|
||||
background-image: linear-gradient(90deg, #ffc108, #fde586);
|
||||
background: #ffc108;
|
||||
|
||||
&.process--ani {
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
margin-top: -16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.btn-container {
|
||||
.btn-item {
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 15rpx;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-item__buy {
|
||||
width: 280rpx;
|
||||
margin-right: 30rpx;
|
||||
background-image: linear-gradient(90deg, #fa9e1b, #fe5b1b);
|
||||
box-shadow: #fe5b1b 0 22rpx 48rpx -22rpx;
|
||||
|
||||
&.complete {
|
||||
width: 360rpx;
|
||||
animation: btn_anim 0.9s linear infinite;
|
||||
transform-origin: center;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-item__main {
|
||||
width: 320rpx;
|
||||
background-image: linear-gradient(90deg, #fe316c, #fd584e);
|
||||
box-shadow: #fd584e 0 22rpx 48rpx -22rpx;
|
||||
animation: btn_anim 0.9s linear infinite;
|
||||
transform-origin: center;
|
||||
}
|
||||
|
||||
.btn-item-long {
|
||||
max-width: 400rpx;
|
||||
}
|
||||
|
||||
/* 按钮动画 */
|
||||
@keyframes btn_anim {
|
||||
0% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
40% {
|
||||
-webkit-transform: scale(1.05);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
/* 好友助力榜 */
|
||||
.records-container {
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.records {
|
||||
position: relative;
|
||||
color: #404040;
|
||||
box-shadow: 0 4rpx 40rpx 0 rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.records-back {
|
||||
position: absolute;
|
||||
left: -14rpx;
|
||||
right: -14rpx;
|
||||
top: -14rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 28rpx;
|
||||
z-index: 1;
|
||||
background: #cb272d;
|
||||
}
|
||||
|
||||
.records-content {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
|
||||
.records-h2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 60rpx;
|
||||
align-items: center;
|
||||
font-weight: 700;
|
||||
font-size: 34rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.friend-help {
|
||||
overflow: hidden;
|
||||
padding: 40rpx 0 20rpx;
|
||||
transition: max-height 0.6s ease-out;
|
||||
}
|
||||
|
||||
.records-left,
|
||||
.records-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.records-left {
|
||||
.nick-name {
|
||||
display: inline-block;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.records-left .nick-name,
|
||||
.records-right {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.records-right {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.red {
|
||||
color: #e53a40;
|
||||
}
|
||||
}
|
||||
|
||||
// 砍价规则(弹窗)
|
||||
.pops-content {
|
||||
padding: 30rpx 48rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: left;
|
||||
color: #606266;
|
||||
min-height: 320rpx;
|
||||
max-height: 640rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user