店铺会员制Vip功能增加

This commit is contained in:
2022-08-11 15:48:33 +08:00
parent 7e8ed7115d
commit 4b3d83007b
35 changed files with 6869 additions and 2379 deletions

View File

@@ -1,338 +1,410 @@
<template>
<view class="content">
<!-- address -->
<block v-if="address != ''">
<view class="block address" @click="$Router.push({name: 'Address'})">
<uni-icons class="address-icon location" type="location-filled" size="24" color="#34CE98"></uni-icons>
<uni-icons class="address-icon arrows" type="right" size="20" color="#999"></uni-icons>
<view class="user"><text>{{address.name}}</text>{{address.mobile}}</view>
<view class="city">{{address.full_address}}</view>
</view>
</block>
<block v-else>
<view class="block address-new" @click="$Router.push({name: 'Address'})">
<uni-icons class="icon" type="plus" size="26" color="#34CE98"></uni-icons>添加收货地址
</view>
</block>
<!-- 订单产品 -->
<view class="block goods-box">
<block v-for="(item, index) in goodsInfo" :key="index">
<view class="goods-item">
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order-title">
<view class="title"> {{item.items[0].title}}</view>
<view class="subtitle" v-if="item.items[0] && item.items[0].value"> {{item.items[0].value}} </view>
</view>
<view class="order-count">
<view class="order-price">{{item.items[0].price}}<text class="type">DT积分</text></view>
</view>
</view>
</block>
</view>
<!-- 订单信息 -->
<view class="block info-box">
<view class="info-item">
<view class="label">购买数量</view>
<uni-number-box class="info-number" :value="qty" :min="1" :max="999" @change="numberChange" />
</view>
<view class="info-item">
<view class="label">配送方式</view>
<view class="nowrap">快递</view>
</view>
<view class="info-item">
<view class="label">配送费用</view>
<view class="nowrap">{{freight == 0 ? '免费': freight}}</view>
</view>
</view>
<view class="block info-box">
<view class="info-item">
<view class="label">订单备注</view>
<textarea class="info-textarea" v-model="remark" placeholder="请输入备注"></textarea>
</view>
</view>
<!-- footer -->
<view class="order-footer">
<view class="total">总计<text>{{total}} <text class="type">DT积分</text></text></view>
<button class="btn" @click="subOrder">确认订单</button>
</view>
</view>
</template>
<script>
import { buy, verify } from '@/apis/interfaces/store'
export default {
data() {
return {
qty : 0,
goodsInfo : [],
total : 0,
freight : 0,
address : "",
remark : "",
canApply :true
};
},
onShow(){
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
this.qty= this.$Route.query.qty;
},
mounted() {
this.getBuy()
},
methods:{
getBuy(){
buy({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty
}).then(res => {
this.address = res.address
this.freight = res.freight
this.total = res.total
this.goodsInfo = res.detail
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
numberChange(e){
this.qty = e
this.getBuy()
},
// 确认订单
subOrder(){
if(this.address === ""){
uni.showModal({
title : '提示',
content : '暂未添加收货地址,无法下单',
showCancel : true,
confirmText : '添加',
success : res => {
if(res.confirm){
this.$Router.push({name: 'Address'})
}
}
})
return
}
if(this.canApply){
this.canApply = false;
verify({
goods_sku_id: this.$Route.query.skuId,
qty : this.qty,
address_id : this.address.address_id,
remark : this.remark || ''
}).then(res => {
this.$store.commit('setAddress', {})
this.$Router.replace({
name: 'Pay',
params: {
orderNo: res.order_no,
price : res.total,
coins : res.coins,
}
})
this.canApply = true
}).catch(err=>{
this.canApply = true
})
}else{
this.canApply = true
}
}
}
}
</script>
<style lang="scss" scoped>
.content{
background: $window-color;
min-height: 100vh;
overflow: hidden;
padding-bottom: $padding + 80;
box-sizing: border-box;
}
.block{
background: white;
margin: $margin;
border-radius: $radius;
}
// 地址管理
.address{
position: relative;
padding: $padding 80rpx $padding 90rpx;
font-size: $title-size-lg;
.user{
font-size: $title-size;
line-height: 40rpx;
color: $text-gray;
text{
color: black;
max-width: 200rpx;
display: inline-block;
margin-right: $margin/2;
}
}
.city{
padding-top: $padding/2;
font-size: $title-size-sm;
color: $text-gray;
line-height: 36rpx;
}
.address-icon{
position: absolute;
top: 50%;
&.location{
margin-top: -26rpx;
left: $margin - 10;
}
&.arrows{
margin-top: -20rpx;
right: $margin - 10;
}
}
}
.address-new{
padding: $padding;
text-align: center;
height: 90rpx;
line-height: 90rpx;
color: $main-color;
.icon{
vertical-align: middle;
margin-bottom: 8rpx;
margin-right: 10rpx;
}
}
// 订单列表
.goods-item{
display: flex;
align-items: center;
padding: $padding;
.order-cover{
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order-title{
flex: 1;
padding-left: $margin;
// line-height: 40rpx;
.title{
font-size: 28rpx;
@extend .ellipsis;
text-align: left;
}
.subtitle{
font-size: 26rpx;
color: #666;
padding-top: 10rpx;
}
}
.order-count{
text-align: right;
padding-left: $margin;
line-height: 40rpx;
.order-price{
font-size: 32rpx;
font-weight: bold;
color: $text-price;
&>text{
font-size: 24rpx;
}
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
.order-sum{
font-size: $title-size-sm;
color: $text-gray;
}
}
}
// 订单信息
.info-box{
.info-item{
position: relative;
padding: $padding $padding $padding 200rpx;
font-size: $title-size-m;
min-height: 40rpx;
text-align: right;
.label{
position: absolute;
left: $margin;
top: $margin;
color: $text-gray;
}
.info-textarea{
height: 120rpx;
width: 100%;
text-align: left;
font-size: $title-size-m;
}
&::after{
position: absolute;
left: $margin;
right: $margin;
content: " ";
height: 1rpx;
bottom: 0;
background: $border-color;
}
&:last-child::after{
display: none;
}
}
}
// footer
.order-footer{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
z-index: 99;
display: flex;
.total{
line-height: 80rpx;
font-size: $title-size-lg;
font-weight: bold;
width: calc(100% - 300rpx - #{$margin});
color: $text-gray;
font-weight: normal;
@extend .nowrap;
text{
color: $text-price;
font-size: $title-size-lg;
font-weight: bold;
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
}
.btn{
margin-left: $margin;
width: 300rpx;
height: 80rpx;
padding: 0;
line-height: 80rpx;
font-size: $title-size-lg;
border-radius: 40rpx;
background: $main-color;
color: white;
font-weight: bold;
&::after{
display: none;
}
}
}
<template>
<view class="content">
<!-- address -->
<block v-if="address != ''">
<view class="block address" @click="$Router.push({name: 'Address'})">
<uni-icons class="address-icon location" type="location-filled" size="24" color="#34CE98"></uni-icons>
<uni-icons class="address-icon arrows" type="right" size="20" color="#999"></uni-icons>
<view class="user"><text>{{address.name}}</text>{{address.mobile}}</view>
<view class="city">{{address.full_address}}</view>
</view>
</block>
<block v-else>
<view class="block address-new" @click="$Router.push({name: 'Address'})">
<uni-icons class="icon" type="plus" size="26" color="#34CE98"></uni-icons>添加收货地址
</view>
</block>
<!-- 订单产品 -->
<view class="block goods-box">
<block v-for="(item, index) in goodsInfo" :key="index">
<view class="goods-item">
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order-title">
<view class="title"> {{item.items[0].title}}</view>
<view class="subtitle" v-if="item.items[0] && item.items[0].value"> {{item.items[0].value}}
</view>
</view>
<view class="order-count">
<view class="order-price">{{item.items[0].price}}<text class="type">DT积分</text></view>
</view>
</view>
</block>
</view>
<!-- 订单信息 -->
<view class="block info-box">
<view class="info-item">
<view class="label">购买数量</view>
<uni-number-box class="info-number" :value="qty" :min="1" :max="999" @change="numberChange" />
</view>
<view class="info-item">
<view class="label">配送方式</view>
<view class="nowrap">快递</view>
</view>
<view class="info-item">
<view class="label">配送费用</view>
<view class="nowrap">{{freight == 0 ? '免费': freight}}</view>
</view>
</view>
<view class="block info-box">
<view class="info-item">
<view class="label">订单备注</view>
<textarea class="info-textarea" v-model="remark" placeholder="请输入备注"></textarea>
</view>
</view>
<!-- footer -->
<view class="order-footer">
<view class="total">总计<text>{{total}} <text class="type">DT积分</text></text></view>
<button class="btn" @click="subOrder">确认订单</button>
</view>
</view>
</template>
<script>
import {
buy,
verify
} from '@/apis/interfaces/store'
export default {
data() {
return {
qty: 0,
goodsInfo: [],
total: 0,
freight: 0,
address: "",
remark: "",
canApply: true
};
},
onShow() {
if (JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
this.qty = this.$Route.query.qty;
},
mounted() {
this.getBuy()
},
methods: {
getBuy() {
buy({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty
}).then(res => {
this.address = res.address
this.freight = res.freight
this.total = res.total
this.goodsInfo = res.detail
}).catch(err => {
uni.showModal({
title: '温馨提示',
content: err.message,
showCancel: false,
confirmColor: '#34CE98',
cancelText: '知道了',
success: (res) => {
uni.navigateBack({ })
}
})
})
},
numberChange(e) {
this.qty = e
this.getBuy()
},
// 确认订单
subOrder() {
if (this.address === "") {
uni.showModal({
title: '提示',
content: '暂未添加收货地址,无法下单',
showCancel: true,
confirmText: '添加',
success: res => {
if (res.confirm) {
this.$Router.push({
name: 'Address'
})
}
}
})
return
}
if (this.canApply) {
this.canApply = false;
verify({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty,
address_id: this.address.address_id,
remark: this.remark || ''
}).then(res => {
console.log(res)
if (res.order_no === '') {
uni.showModal({
title: ' 温馨提示',
content: '领取商品成功',
confirmColor: '#34CE98',
confirmText: ' 查看订单',
cancelColor: '#999',
cancelText: '返回首页',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/order/index?index=0'
})
}
if (res.cancel) {
uni.reLaunch({
url: '/pages/store/index'
})
}
}
})
} else {
this.$store.commit('setAddress', {})
this.$Router.replace({
name: 'Pay',
params: {
orderNo: res.order_no,
price: res.total,
coins: res.coins,
}
})
}
this.canApply = true
}).catch(err => {
this.canApply = true
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 2000
})
})
} else {
this.canApply = true
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
background: $window-color;
min-height: 100vh;
overflow: hidden;
padding-bottom: $padding + 80;
box-sizing: border-box;
}
.block {
background: white;
margin: $margin;
border-radius: $radius;
}
// 地址管理
.address {
position: relative;
padding: $padding 80rpx $padding 90rpx;
font-size: $title-size-lg;
.user {
font-size: $title-size;
line-height: 40rpx;
color: $text-gray;
text {
color: black;
max-width: 200rpx;
display: inline-block;
margin-right: $margin/2;
}
}
.city {
padding-top: $padding/2;
font-size: $title-size-sm;
color: $text-gray;
line-height: 36rpx;
}
.address-icon {
position: absolute;
top: 50%;
&.location {
margin-top: -26rpx;
left: $margin - 10;
}
&.arrows {
margin-top: -20rpx;
right: $margin - 10;
}
}
}
.address-new {
padding: $padding;
text-align: center;
height: 90rpx;
line-height: 90rpx;
color: $main-color;
.icon {
vertical-align: middle;
margin-bottom: 8rpx;
margin-right: 10rpx;
}
}
// 订单列表
.goods-item {
display: flex;
align-items: center;
padding: $padding;
.order-cover {
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order-title {
flex: 1;
padding-left: $margin;
// line-height: 40rpx;
.title {
font-size: 28rpx;
@extend .ellipsis;
text-align: left;
}
.subtitle {
font-size: 26rpx;
color: #666;
padding-top: 10rpx;
}
}
.order-count {
text-align: right;
padding-left: $margin;
line-height: 40rpx;
.order-price {
font-size: 32rpx;
font-weight: bold;
color: $text-price;
&>text {
font-size: 24rpx;
}
}
.type {
font-size: 22rpx;
padding-left: 6rpx;
}
.order-sum {
font-size: $title-size-sm;
color: $text-gray;
}
}
}
// 订单信息
.info-box {
.info-item {
position: relative;
padding: $padding $padding $padding 200rpx;
font-size: $title-size-m;
min-height: 40rpx;
text-align: right;
.label {
position: absolute;
left: $margin;
top: $margin;
color: $text-gray;
}
.info-textarea {
height: 120rpx;
width: 100%;
text-align: left;
font-size: $title-size-m;
}
&::after {
position: absolute;
left: $margin;
right: $margin;
content: " ";
height: 1rpx;
bottom: 0;
background: $border-color;
}
&:last-child::after {
display: none;
}
}
}
// footer
.order-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
z-index: 99;
display: flex;
.total {
line-height: 80rpx;
font-size: $title-size-lg;
font-weight: bold;
width: calc(100% - 300rpx - #{$margin});
color: $text-gray;
font-weight: normal;
@extend .nowrap;
text {
color: $text-price;
font-size: $title-size-lg;
font-weight: bold;
}
.type {
font-size: 22rpx;
padding-left: 6rpx;
}
}
.btn {
margin-left: $margin;
width: 300rpx;
height: 80rpx;
padding: 0;
line-height: 80rpx;
font-size: $title-size-lg;
border-radius: 40rpx;
background: $main-color;
color: white;
font-weight: bold;
&::after {
display: none;
}
}
}
</style>

View File

@@ -9,20 +9,20 @@
</view>
</swiper-item>
</swiper>
<view class="swiper-pages">
{{current}}/{{goods.pictures.length}}
</view>
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
<view class="vipGoodsInfo" v-if="shop_vip.status" >{{shop_vip.message}} </view>
<view class="vipGoodsInfo" v-if="goods.is_active " >拼团商品</view>
</view>
<!-- 详情 -->
<view class="main">
<view class="title"> {{goods.name}} </view>
<view class="sub-title">{{goods.description}}</view>
<view class="box-flex">
<view class="price">
{{goods.price.show}}<text>DT积分</text>
</view>
<view class="price">
{{goods.price.show}}<text>DT积分</text>
<span class ='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
</view>
<view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}</view>
<view class="_pin" v-if="goods.is_active">
<view class="_has" v-if="goods.active.count>0">
<image src="/static/book/fire.png" mode="widthFix" class="fire" /> 已拼{{goods.active.count}}
@@ -35,6 +35,7 @@
<uni-icons type="right" color="#cacaca" />
</view>
<!-- 可拼团列表 -->
<view class="is_active" v-if="goods.is_active && actives.length>0">
<view class="title" v-if="actives.length > 2">
这些人刚刚拼单成功可参与拼单
@@ -42,9 +43,7 @@
<uni-icons type="right" color="#cacaca" />
</span>
</view>
<view class="title" v-if="actives.length <= 2">
{{actives.length}}人正在拼单可参与拼单
</view>
<view class="title" v-if="actives.length <= 2"> {{actives.length}}人正在拼单可参与拼单 </view>
<view class="content">
<block v-for="(item,index) in actives" :key="index">
<view class="content-item" v-if="index < 2">
@@ -52,7 +51,7 @@
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.name}}</view>
</view>
<view class="btn">去拼单</view>
<view class="btn" @click="toPin(item)">去拼单</view>
</view>
</block>
</view>
@@ -66,10 +65,7 @@
<view class="shop-titl">{{goods.shop.name}}</view>
<view> 店铺评分:
<span class='no'>5.0</span>
<text style="padding-left: 20rpx;">
服务态度:
<span class='no'>5.0</span>
</text>
<text style="padding-left: 20rpx;"> 服务态度: <span class='no'>5.0</span> </text>
</view>
</view>
</view>
@@ -78,18 +74,26 @@
</view>
</view>
<view class="imgs">
<!-- 商品详情 -->
<view class="imgs">
<u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请再购买戒指时参照详情介绍备注所选尺寸" fontSize='14' />
<block v-for="(item, index) in goods.content" :key="index">
<image :src="item" mode="widthFix" />
</block>
</view>
</view>
<!-- 立即购买 -->
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 否则的就却分是拼团商品还是普通商品 -->
<view class="footer">
<view @click="toShop(goods.shop.shop_id)" class=" shop">
<view @click="toShop(goods.shop.shop_id)" class="shop">
<uni-icons type="shop" size="26" color="grey" />店铺
</view>
<button type="default" hover-class="none" @click="buy">立即购买</button>
<!-- vip 规格弹窗立即领取 -->
<button type="default" v-if="shop_vip.status" hover-class="none" @click="vipBuy">立即领取</button>
<!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 -->
<block v-else>
<button type="default" hover-class="none" @click="buy">立即购买</button>
</block>
</view>
<!-- 更多拼单弹窗 -->
<u-popup :show="getMorePin" :round="10" mode="center" @close="close" :closeable='true' zIndex="1229930">
@@ -102,13 +106,26 @@
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.name}}</view>
</view>
<view class="btn">去拼单</view>
<view class="btn" @click="toPin(item)">去拼单</view>
</view>
</block>
</view>
</scroll-view>
</u-popup>
<!-- 与谁谁的拼团 -->
<u-popup :show="pinShow" :round="10" mode="center" @close="close" :closeable='true' zIndex="1229930">
<view scroll-y="true" class="content-2">
<view class="title"> 参与张三的拼单 </view>
<view class="number">仅剩<span>1</span>个名额</view>
<view class="avatars">
<image class="avatar me" src="/static/book/333.png" mode="aspectFill" />
<image class="wen pin" src="/static/book/wen.png" mode="aspectFill" />
</view>
<view class="applyPin" @click="applyPin"> 参与拼单 </view>
</view>
</u-popup>
<!-- 多规格弹窗 -->
<u-popup :show="skuShow" :round="10" mode="bottom" @close="close" @open="open">
<scroll-view class="skuView" scroll-y="true">
@@ -128,9 +145,7 @@
<view class="sku-list">
<block v-for="it in item.values" :keys='it.value_id'>
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
@click="clickSkus(index,it.value_id)">
{{it.value}}
</view>
@click="clickSkus(index,it.value_id)"> {{it.value}} </view>
</block>
</view>
</view>
@@ -141,7 +156,15 @@
@change="qty = $event" />
</view>
<button class="now-buy" type="default" hover-class="none" @click="buy2(selectSkusValues)">立即购买</button>
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 只支持单规格php 规定不支持多规格 否则的就却分是拼团商品还是普通商品 -->
<!-- vip 规格弹窗立即领取 -->
<button class="now-buy" type="default" v-if="shop_vip.status" hover-class="none"
@click="vipBuy">立即领取</button>
<!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 -->
<block v-else>
<button class="now-buy" type="default" hover-class="none"
@click="buy2(selectSkusValues)">立即购买</button>
</block>
</scroll-view>
</u-popup>
</view>
@@ -174,120 +197,29 @@
selectSkusValues: {},
qty: 1,
actives: [{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/2.jpg'
],
name: "洛基洛基、张三张三张三张三张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
},
{
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/1.jpg'
],
name: "卢比卢比、张三张三"
}
],
getMorePin: false,
urls: [
'https://cdn.uviewui.com/uview/album/1.jpg',
'https://cdn.uviewui.com/uview/album/2.jpg'
],
name: "洛基洛基、张三张三张三张三张三张三"
}, ],
getMorePin: false, // 更多可拼团列表是否显示
pinShow: false, // 与谁谁谁的拼团是否显示
shop_vip: {
// "status": true, // 当前店铺是否是会员制店铺 true 是 false 否
// "is_vip": true, // 当前会员是否是 vip true 是会员 false 非会员
// "is_receive": false // 当前会员是否已领取过 false 未领取 true 已领取
},
};
},
mounted() {
onShow() {
this.getGoods()
},
methods: {
getGoods() {
// let id = this.$Route.query.id
let id = this.$Route.query.id
// let id = 61; // 普通商品
let id = 90; // 拼团商品
// let id = 91; // 拼团商品
goods(id).then(res => {
this.goods = res
this.specs = res.specs
@@ -296,6 +228,7 @@
this.unitText = res.skus[0].unit_text
this.specselect = res.skus[0].unit.split('|')
this.selectSkusValues = res.skus[0]
this.shop_vip = res.shop_vip
})
},
open() {
@@ -305,10 +238,16 @@
close() {
this.skuShow = false
this.getMorePin = false
this.pinShow = false
this.qty = 1;
// this.specselect = this.skus[0].unit.split('|')
// this.selectSkusValues = this.skus[0]
},
// 去拼单
toPin(item) {
this.close();
this.pinShow = true
},
clickSkus(index, id) {
this.skuid = ''
this.specselect[index] = id;
@@ -339,8 +278,56 @@
}
}
this.specselect = newlist
},
// 会员商品领取
vipBuy() {
if (this.shop_vip.is_vip) {
if (this.shop_vip.is_receive) {
uni.showModal({
title: '温馨提示',
content: '您已经领取过商品想要获得更多新商品,请联系线下商家:' + this.goods.shop.mobile+'进行更换',
cancelText: '再看看',
cancelColor: '#999',
showCancel:false,
confirmColor: '#34ce98',
confirmText: ' 知道了',
// success: (res) => {
// if (res.confirm) {
// //#ifdef MP-WEIXIN
// uni.makePhoneCall({
// phoneNumber: '18354789632'
// });
// //#endif
// //#ifdef APP-PLUS
// plus.device.dial('18354789632', true);
// //#endif
// }
// }
})
} else {
console.log('已经是会员,且未领取领取了商品,')
this.goUrl();
}
} else {
uni.showModal({
title: '温馨提示',
content: '您还不是该店铺的会员',
cancelColor: '#999',
cancelText: '再想想',
confirmColor: "#34ce98",
confirmText: '立即开通',
success: (res) => {
if (res.confirm) {
this.close();
uni.navigateTo({
url: '/pages/store/vip/index/index?id=' + this.goods.shop
.shop_id,
})
}
}
})
}
},
buy() {
if (this.$store.state.token === '') {
const Auth = new userAuth()
@@ -352,7 +339,6 @@
return
}
this.goUrl();
},
buy2(value) {
let {
@@ -389,6 +375,11 @@
}
})
},
applyPin() {
uni.navigateTo({
url: '/pages/store/vip/success/success'
})
}
}
}
</script>
@@ -432,6 +423,17 @@
color: white;
font-size: $title-size-m;
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
}
.vipGoodsInfo{
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
background-color: #d81e06;
color: #fff;
font-size: 30rpx;
padding: 4rpx 30rpx;
border-radius: 0 0 40rpx 0;
}
}
@@ -503,6 +505,13 @@
text {
font-size: 60%;
margin-left: 10rpx;
}
.del{
text-decoration: line-through;
margin-left: 20rpx;
font-size: 26rpx;
color:#999;
font-weight: normal;
}
}
@@ -743,7 +752,7 @@
.getPinTitle {
text-align: center;
font-size: 30rpx;
font-size: 34rpx;
color: #333333;
font-weight: bold;
padding: $padding - 10 0;
@@ -751,11 +760,94 @@
position: absolute;
top: 0;
width: 100%;
background-color: #fff !important;
border-radius: 20rpx 20rpx 0 0;
background-color: #fff !important;
border-radius: 20rpx 20rpx 0 0;
z-index: 1000000000000000;
}
.content-2 {
width: 70vw;
.title {
font-size: 34rpx;
color: #333333;
font-weight: bold;
padding-top: 50rpx;
text-align: center;
}
.number {
color: #333333;
font-size: 28rpx;
text-align: center;
color: #999;
padding-top: 20rpx;
}
.avatars {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding-top: $padding * 2;
position: relative;
image {
width: 90rpx;
height: 90rpx;
margin: 10rpx 20rpx;
border-radius: 50%;
}
.me {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '我';
border-radius: 20rpx;
background: $main-color;
padding: 4rpx 34rpx;
text-align: center;
font-size: 24rpx;
color: #fff;
}
}
.pin {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '拼主';
border-radius: 20rpx;
background: orange;
padding: 4rpx 20rpx;
font-size: 24rpx;
color: #fff;
}
}
}
.applyPin {
margin: $margin;
background-color: $main-color;
color: #fff;
padding: $padding - 10;
text-align: center;
margin-top: 50rpx;
border-radius: 10rpx;
}
}
.getPinList {
width: 80vw;
max-height: 60vh;
@@ -806,7 +898,6 @@
}
}
}
}
// 规格弹窗

View File

@@ -1,391 +1,503 @@
<template>
<view class="content">
<!-- swiper -->
<view class="swiper">
<view class="swiper-box">
<swiper autoplay @change="swiperCount = $event.detail.current">
<swiper-item v-for="(item, index) in banners" :key="index" @click="goBook(item)">
<image :src="item.cover" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="swiper-pages">
<block v-for="(item, index) in banners" :key="index">
<text class="pages-item" :class="{'show':swiperCount === index}"></text>
</block>
</view>
</view>
</view>
<!-- 健康产品分类 -->
<u-scroll-list class="classify-box" indicatorColor="#ddd" indicatorActiveColor="#34CE98">
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item" @click="$Router.push({name: 'StoreList', params: {id: item.category_id, title: item.name}})">
<view class="classify-item-nav">
<image class="classify-item-cover" :src="item.cover"></image>
<view class="classify-item-title">{{item.name}}</view>
</view>
</view>
</u-scroll-list>
<!-- 每日上新 -->
<view class="new-box">
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
<view class="news">
<view class="news-item" v-for="(item, index) in newGood" :key="index" @click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
</view>
</view>
</view>
<!-- 线下商家 -->
<view class="offline-box">
<view class="title">推荐店铺 <view class="more"><text class="title-des"> | 您身边的优质体验店</text> <text class="more-txt" @click="$Router.push({name: 'ShopList'})">更多></text></view></view>
<view class="card-box">
<block v-for="(item, index) in shops" :key="index">
<view class="card-box-item" style="{'backgrond': #FFF}" v-if="index < 4" @click="$Router.push({name: 'ShopDetail', params: {ShopId: item.shop_id}})">
<view class="card-title">{{item.name}}</view>
<view class="card-subtitle"> 优质店铺 </view>
<view class="card-btn">前往体验</view>
<image class="card-cover" :src="item.cover" mode="aspectFill" />
</view>
</block>
</view>
</view>
<!-- 推荐品类 -->
<!-- <view class="card-box">
<block v-for="(item, index) in meals" :key="index">
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreMeals', params: {id: item.meal_id}})">
<view class="card-title">{{item.title}}</view>
<view class="card-subtitle">{{item.subtitle}}</view>
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
</view>
</block>
</view> -->
<!-- goods -->
<view class="goods-box">
<oct-goods
:lists="goodsArr"
priceType="DT"
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
<!-- <u-loadmore status="loading" /> -->
</view>
</view>
</template>
<script>
import { mall } from "@/apis/interfaces/store"
export default {
data() {
return {
swiperCount : 0,
banners : [],
goodTabs : [],
newGood : [],
goodsArr : [],
meals : [],
shops : [],
};
},
mounted(){
this.getMall()
},
methods:{
getMall(){
mall().then(res => {
this.banners = res.banners
this.goodsArr = res.goods
this.newGood = res.news
this.goodTabs = res.categories
this.meals = res.meals
this.shops = res.shops
uni.stopPullDownRefresh()
})
},
goBook(item){
if(item.url){
if(item.url.openType === 'navigateTo'){
uni.navigateTo({
url:item.url.path
})
}
}
}
},
onPullDownRefresh() {
this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'StoreSearch'})
}
}
</script>
<style lang="scss">
.content{
background: $window-color;
}
// 商城列表
.goods-box{
padding-bottom: $padding;
&>.title{
padding: $padding $padding 0;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-bottom: -$margin/2;
}
}
// 商城分类
.classify-box{
.classify-item{
padding: 0 10rpx;
&:last-child{
padding-right: $padding;
}
&:first-child{
padding-left: $padding;
}
&-nav{
text-align: center;
width: 138rpx;
}
&-cover{
width: 86rpx;
height: 86rpx;
border-radius: 50%;
vertical-align: top;
margin-bottom: $margin/2;
}
&-title{
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-color;
}
}
}
// 卡片推荐
.card-box{
padding: $padding $padding - 10;
padding-bottom: 0;
display: flex;
flex-wrap: wrap;
&-item{
margin: 0 10rpx;
width: calc(50% - 20rpx);
padding: $padding;
border-radius: $radius;
box-sizing: border-box;
position: relative;
.card-title{
font-size: $title-size-lg;
font-weight: bold;
color: $text-color;
line-height: 40rpx;
width: calc(100% - 80rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle{
font-size: 22rpx;
color: $text-gray;
// line-height: 40rpx;
min-height: 20rpx;
@extend .nowrap;
}
.card-cover{
width: 80rpx;
height: 80rpx;
position: absolute;
border-radius: 50%;
right: $margin;
top: $margin;
}
}
&-item:nth-child(1){
background: #fef2ae;
}
&-item:nth-child(2){
background: #c9ead9;
}
}
// 上新精选
.new-box{
padding: 0 $margin;
border-radius: $radius;
// padding: $padding - 10;
.title{
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
padding-bottom: 10rpx;
.title-des{
font-size: 24rpx !important;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
}
.news{
margin: $margin/2 -10rpx 0;
display: flex;
.news-item{
margin: 0 10rpx;
width: calc(25% - 20rpx);
.news-cover{
position: relative;
width: 100%;
padding-top: 100%;
background-color: white;
border-radius: $radius-lg;
overflow: hidden;
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.news-title{
margin-top: $margin/2;
font-size: $title-size-sm;
text-align: center;
color: $text-color;
line-height: 40rpx;
}
.news-price{
text-align: center;
font-size: $title-size-sm;
font-weight: bold;
color: $text-price;
line-height: 40rpx;
text{
margin-left: 6rpx;
font-size: 70%;
}
}
}
}
}
.offline-box{
.title{
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-top: $margin;
margin-left: $margin;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.more{
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt{
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.card-btn{
font-size: 22rpx;
color: #fff;
padding: 4rpx 20rpx;
border-radius: 20rpx;
background-color: $text-price;
display: inline-block;
}
.card-box {
// &-item{
// background: #fff !important;
// }
&-item:nth-child(1){
background: #fef2ae;
background: rgba($color: #fef2ae, $alpha:.5);
}
&-item:nth-child(2){
background: #c9ead9;
background: rgba($color: #c9ead9, $alpha:.5);
}
&-item:nth-child(3){
margin-top: $padding - 8;
background: #bde0ff;
background: rgba($color: #bde0ff, $alpha:.5);
}
&-item:nth-child(4){
margin-top: $padding - 8;
background: rgba($color: #ffd9e1, $alpha:.5);
}
}
.card-cover{
width: 100rpx;
height: 100rpx;
position: absolute;
right: $margin;
top: $margin;
}
.title-des{
font-size: 24rpx;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
}
// swiper
.swiper{
background: linear-gradient(#FFF, #F3F6FB);
padding: $padding;
.swiper-box{
position: relative;
padding-top: 40%;
swiper,
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
image{
border-radius: $radius;
}
}
.swiper-pages{
position: absolute;
z-index: 9;
left: 0;
right: 0;
bottom: $margin - 10;
height: 7rpx;
text-align: center;
.pages-item{
vertical-align: top;
display: inline-block;
height: 7rpx;
width: 25rpx;
margin: 0 5rpx;
background: rgba($color: #fff, $alpha: .5);
&.show{
background: white;
}
}
}
}
<template>
<view class="content">
<!-- swiper -->
<view class="swiper">
<view class="swiper-box">
<swiper autoplay @change="swiperCount = $event.detail.current">
<swiper-item v-for="(item, index) in banners" :key="index" @click="goBook(item)">
<image :src="item.cover" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="swiper-pages">
<block v-for="(item, index) in banners" :key="index">
<text class="pages-item" :class="{'show':swiperCount === index}"></text>
</block>
</view>
</view>
</view>
<!-- 健康产品分类 -->
<u-scroll-list class="classify-box" indicatorColor="#ddd" indicatorActiveColor="#34CE98">
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item"
@click="$Router.push({name: 'StoreList', params: {id: item.category_id, title: item.name}})">
<view class="classify-item-nav">
<image class="classify-item-cover" :src="item.cover"></image>
<view class="classify-item-title">{{item.name}}</view>
</view>
</view>
</u-scroll-list>
<!-- 每日上新 -->
<view class="new-box">
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
<view class="news">
<view class="news-item" v-for="(item, index) in newGood" :key="index"
@click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
</view>
</view>
</view>
<!-- VIP换购 -->
<view class="new-box" style="margin-top: 30rpx;" v-if="vips.length>0">
<view class="title">VIP换购 <view class="more"><text class="title-des"> | 千款商品任意换购</text> <text
class="more-txt" @click="$Router.push({name: 'VipList'})">更多 ></text></view>
</view>
<view class="news">
<view class="news-item" v-for="(item, index) in vips" :key="index"
@click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
<view class="tags"> VIP </view>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
</view>
</view>
</view>
<!-- 线下商家 -->
<view class="offline-box">
<view class="title">推荐店铺 <view class="more"><text class="title-des"> | 您身边的优质体验店</text> <text
class="more-txt" @click="$Router.push({name: 'ShopList'})">更多 ></text></view>
</view>
<view class="card-box">
<block v-for="(item, index) in shops" :key="index">
<view class="card-box-item" style="{'backgrond': #FFF}" v-if="index < 4"
@click="$Router.push({name: 'ShopDetail', params: {ShopId: item.shop_id}})">
<view class="card-title">{{item.name}}</view>
<view class="card-subtitle"> 优质店铺 </view>
<view class="card-btn">前往体验</view>
<image class="card-cover" :src="item.cover" mode="aspectFill" />
</view>
</block>
</view>
</view>
<!-- 推荐品类 -->
<!-- <view class="card-box">
<block v-for="(item, index) in meals" :key="index">
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreMeals', params: {id: item.meal_id}})">
<view class="card-title">{{item.title}}</view>
<view class="card-subtitle">{{item.subtitle}}</view>
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
</view>
</block>
</view> -->
<!-- goods -->
<view class="goods-box">
<oct-goods :lists="goodsArr" priceType="DT" color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})" />
<!-- <u-loadmore status="loading" /> -->
</view>
</view>
</template>
<script>
import {
mall
} from "@/apis/interfaces/store"
export default {
data() {
return {
swiperCount: 0,
banners: [],
goodTabs: [],
newGood: [],
goodsArr: [],
meals: [],
shops: [],
vips:[]
};
},
mounted() {
this.getMall()
},
methods: {
getMall() {
mall().then(res => {
this.banners = res.banners
this.goodsArr = res.goods
this.newGood = res.news
this.goodTabs = res.categories
this.meals = res.meals
this.shops = res.shops
this.vips = res.vips
uni.stopPullDownRefresh()
})
},
goBook(item) {
console.log(item)
if (item.url) {
if (item.url.openType === 'navigateTo') {
if (item.url.params != '') {
uni.navigateTo({
url: item.url.path + '?' + item.url.params,
})
} else {
uni.navigateTo({
url: item.url.path,
})
}
}
}
}
},
onPullDownRefresh() {
this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({
name: 'StoreSearch'
})
}
}
</script>
<style lang="scss">
.content {
background: $window-color;
}
// 商城列表
.goods-box {
padding-bottom: $padding;
&>.title {
padding: $padding $padding 0;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-bottom: -$margin/2;
}
}
// 商城分类
.classify-box {
.classify-item {
padding: 0 10rpx;
&:last-child {
padding-right: $padding;
}
&:first-child {
padding-left: $padding;
}
&-nav {
text-align: center;
width: 138rpx;
}
&-cover {
width: 86rpx;
height: 86rpx;
border-radius: 50%;
vertical-align: top;
margin-bottom: $margin/2;
}
&-title {
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-color;
}
}
}
// 卡片推荐
.card-box {
padding: $padding $padding - 10;
padding-bottom: 0;
display: flex;
flex-wrap: wrap;
&-item {
margin: 0 10rpx;
width: calc(50% - 20rpx);
padding: $padding;
border-radius: $radius;
box-sizing: border-box;
position: relative;
.card-title {
font-size: $title-size-lg;
font-weight: bold;
color: $text-color;
line-height: 40rpx;
width: calc(100% - 80rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle {
font-size: 22rpx;
color: $text-gray;
// line-height: 40rpx;
min-height: 20rpx;
@extend .nowrap;
}
.card-cover {
width: 80rpx;
height: 80rpx;
position: absolute;
border-radius: 50%;
right: $margin;
top: $margin;
}
}
&-item:nth-child(1) {
background: #fef2ae;
}
&-item:nth-child(2) {
background: #c9ead9;
}
}
// 上新精选
.new-box {
padding: 0 $margin;
border-radius: $radius;
// padding: $padding - 10;
.title {
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
padding-bottom: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title-des {
font-size: 24rpx !important;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
.more {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt {
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.news {
margin: $margin/2 -10rpx 0;
display: flex;
.news-item {
margin: 0 10rpx;
width: calc(25% - 20rpx);
.news-cover {
position: relative;
width: 100%;
padding-top: 100%;
background-color: white;
border-radius: $radius-lg;
overflow: hidden;
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.tags {
position: absolute;
top: 6rpx;
left: -54rpx;
background: #d81e06;
color: #fff;
width: 100%;
font-size: 24rpx;
padding: 4rpx 0;
text-align: center;
transform: rotate(-45deg);
font-weight: bold;
letter-spacing:2rpx;
}
}
.news-title {
margin-top: $margin/2;
font-size: $title-size-sm;
text-align: center;
color: $text-color;
line-height: 40rpx;
}
.news-price {
text-align: center;
font-size: $title-size-sm;
font-weight: bold;
color: $text-price;
line-height: 40rpx;
text {
margin-left: 6rpx;
font-size: 70%;
}
}
}
}
}
.offline-box {
.title {
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-top: $margin;
margin-left: $margin;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.more {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt {
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.card-btn {
font-size: 22rpx;
color: #fff;
padding: 4rpx 20rpx;
border-radius: 20rpx;
background-color: $text-price;
display: inline-block;
}
.card-box {
// &-item{
// background: #fff !important;
// }
&-item:nth-child(1) {
background: #fef2ae;
background: rgba($color: #fef2ae, $alpha:.5);
}
&-item:nth-child(2) {
background: #c9ead9;
background: rgba($color: #c9ead9, $alpha:.5);
}
&-item:nth-child(3) {
margin-top: $padding - 8;
background: #bde0ff;
background: rgba($color: #bde0ff, $alpha:.5);
}
&-item:nth-child(4) {
margin-top: $padding - 8;
background: rgba($color: #ffd9e1, $alpha:.5);
}
}
.card-cover {
width: 100rpx;
height: 100rpx;
position: absolute;
right: $margin;
top: $margin;
}
.title-des {
font-size: 24rpx;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
}
// swiper
.swiper {
background: linear-gradient(#FFF, #F3F6FB);
padding: $padding;
.swiper-box {
position: relative;
padding-top: 40%;
swiper,
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
image {
border-radius: $radius;
}
}
.swiper-pages {
position: absolute;
z-index: 9;
left: 0;
right: 0;
bottom: $margin - 10;
height: 7rpx;
text-align: center;
.pages-item {
vertical-align: top;
display: inline-block;
height: 7rpx;
width: 25rpx;
margin: 0 5rpx;
background: rgba($color: #fff, $alpha: .5);
&.show {
background: white;
}
}
}
}
</style>

View File

@@ -1,401 +1,430 @@
<template>
<view class="shopDetail">
<view class="top">
<view class="search" @click="search">
<uni-icons type="left" class="back" size="30" @click="$Router.back();" />
<view class="input">
<uni-icons type="search" class="search-icon" color="grey" size="20" /> 请输入要搜索商品的关键词
</view>
</view>
<view class="shopInfo">
<view class="shopInfo-title-left">
<image class="shop-logo" :src="logo" mode="aspectFill" />
<view class="shop-title">
<view class="shop-titl">{{name}}</view>
<view>店铺评分:<span class='no'>5.0</span> 服务态度 :<span class='no'>5.0</span></view>
</view>
</view>
<!-- <view class="shopInfo-title-right"> +关注 </view> -->
</view>
</view>
<view class="content">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view :class="['classify-item', item.category_id === category_id?'active_classify_item':'']"
v-for="(item,index) in classify" :key="index" @click="selectClassify(item.category_id)">
{{item.name}}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right" @scrolltolower='lower'>
<block v-if="goods.length > 0">
<view class="goods-item" v-for="(item,index) in goods" :key="index"
@click="onGoods(item.goods_id)">
<image :src="item.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{item.name}}</view>
<view class="sub_title">{{item.shop.name}}</view>
<view class="price">{{item.price.price_min || '0'}}
<view class="price-type">
<text> DT积分</text>
<text class="kucun"> 库存量:{{item.stock}}</text>
</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无相关商品">
</u-empty>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
<view class="shopDetail">
<view class="top">
<view class="search" @click="search">
<uni-icons type="left" class="back" size="30" @click="$Router.back();" />
<view class="input">
<uni-icons type="search" class="search-icon" color="grey" size="20" /> 请输入要搜索商品的关键词
</view>
</view>
<view class="shopInfo">
<view class="shopInfo-title-left">
<image class="shop-logo" :src="logo" mode="aspectFill" />
<view class="shop-title">
<view class="shop-titl">{{name}}</view>
<view>店铺评分:<span class='no'>5.0</span> 服务态度 :<span class='no'>5.0</span></view>
</view>
</view>
<view class="shopInfo-title-right" v-if="shopType === 2" @click="goVip"> {{!vip.status?'开通会员':vip.name}}
</view>
</view>
</view>
<view class="content">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view :class="['classify-item', item.category_id === category_id?'active_classify_item':'']"
v-for="(item,index) in classify" :key="index" @click="selectClassify(item.category_id)">
{{item.name}}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right" @scrolltolower='lower'>
<block v-if="goods.length > 0">
<view class="goods-item" v-for="(item,index) in goods" :key="index"
@click="onGoods(item.goods_id)">
<image :src="item.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{item.name}}</view>
<view class="sub_title">{{item.shop.name}}</view>
<view class="price">{{item.price.price_min || '0'}}
<view class="price-type">
<text> DT积分</text>
<text class="kucun"> 库存量:{{item.stock}}</text>
</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无相关商品">
</u-empty>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import {
shopsDetail,
shopsGoods
} from "@/apis/interfaces/store"
export default {
data() {
return {
name : '',
logo : '',
category_id : '',
classify : [],
goods : [],
has_more:true,
page:1,
ShopId:'',
}
},
onLoad(e) {
this.ShopId = this.$Route.query.ShopId
shopsDetail(this.ShopId).then(res => {
this.classify = [{
category_id: '',
name: '全部商品',
}, ...res.categories]
this.name = res.name
this.logo = res.cover
this.getGoods()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
onPullDownRefresh() {
this.has_more = true;
this.page = 1;
this.goods = [];
this.getGoods()
import {
shopsDetail,
shopsGoods
} from "@/apis/interfaces/store"
export default {
data() {
return {
name: '',
logo: '',
category_id: '',
classify: [],
goods: [],
has_more: true,
page: 1,
ShopId: '',
shopType: '', // 1。普通商品 2.会员制商品
vip: {},
}
},
methods: {
getGoods() {
uni.showLoading({
title:'请求中~',
mask:true,
onLoad(e) {
this.ShopId = this.$Route.query.ShopId
shopsDetail(this.ShopId).then(res => {
// vip 制 商品
if (res.type.code == 2) {
this.classify = [{
category_id: '',
name: '全部活动',
}, ...res.identities]
} else {
// 普通商品
this.classify = [{
category_id: '',
name: '全部商品',
}, ...res.categories]
}
this.name = res.name
this.logo = res.cover
this.vip = res.vip
this.shopType = res.type.code
this.getGoods()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
onPullDownRefresh() {
this.has_more = true;
this.page = 1;
this.goods = [];
this.getGoods()
},
methods: {
getGoods() {
uni.showLoading({
title: '请求中~',
mask: true,
})
let data = {
shop_id: this.ShopId,
page: this.page,
}
if (this.shopType == 2) {
data.identity_id = this.category_id
data.is_user = 1
} else {
data.category_id = this.category_id
}
shopsGoods(data).then(res => {
this.goods = this.goods.concat(res.data);
this.has_more = res.page.has_more;
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
shopsGoods(this.ShopId, this.category_id,this.page).then(res => {
this.goods = this.goods.concat(res.data);
this.has_more = res.page.has_more;
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
lower(){
if(this.has_more){
this.page = this.page + 1
this.getGoods();
}else{
uni.showToast({
title:'没有更多~',
icon:"none",
mask:true,
})
}
},
selectClassify(id) {
if (id === this.category_id) return;
this.category_id = id;
this.page = 1;
this.goods =[];
this.has_more = true;
this.getGoods()
},
search() {
this.$Router.push({
name: 'StoreSearch'
});
},
onGoods(id) {
this.$Router.push({
name: 'StoreGoods',
params: {
id: id
}
})
}
}
}
lower() {
if (this.has_more) {
this.page = this.page + 1
this.getGoods();
} else {
uni.showToast({
title: '没有更多~',
icon: "none",
mask: true,
})
}
},
selectClassify(id) {
if (id === this.category_id) return;
this.category_id = id;
this.page = 1;
this.goods = [];
this.has_more = true;
this.getGoods()
},
search() {
this.$Router.push({
name: 'StoreSearch'
});
},
goVip() {
uni.navigateTo({
url: '/pages/store/vip/index/index?id=' + this.ShopId
})
},
onGoods(id) {
this.$Router.push({
name: 'StoreGoods',
params: {
id: id
}
})
}
}
}
</script>
<style lang="scss">
.pages-empty {
height: 70vh;
}
.pages-empty {
height: 70vh;
}
.shopDetail {
width: 100%;
height: 100vh;
.shopDetail {
width: 100%;
height: 100vh;
.top {
height: 320rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding-top: 44px;
width: 100%;
.top {
height: 320rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding-top: 44px;
width: 100%;
.search {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
width: 100%;
padding-right: $padding;
.search {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
width: 100%;
padding-right: $padding;
.back {
padding: 0 $padding;
}
.back {
padding: 0 $padding;
}
.input {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #f9f9f9;
color: gray;
font-size: 26rpx;
border-radius: 30rpx;
padding: 10rpx $padding;
.input {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #f9f9f9;
color: gray;
font-size: 26rpx;
border-radius: 30rpx;
padding: 10rpx $padding;
.search-icon {
margin-right: $margin;
}
}
}
.search-icon {
margin-right: $margin;
}
}
}
.shopInfo {
border-top: solid 1 #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
padding: $padding - 10;
background-color: #fff;
.shopInfo {
border-top: solid 1 #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
padding: $padding - 10;
background-color: #fff;
.shopInfo-title-left {
width: 500rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shopInfo-title-left {
width: 500rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shop-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
border: solid 1rpx #f9f9f9;
}
.shop-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
border: solid 1rpx #f9f9f9;
}
.shop-title {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 26rpx;
margin-left: $margin;
color: #999;
width: 370rpx;
.shop-title {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 26rpx;
margin-left: $margin;
color: #999;
width: 370rpx;
.no {
color: $text-price;
padding-left: 4rpx;
.no {
color: $text-price;
padding-left: 4rpx;
padding-right: 10rpx;
}
}
.shop-titl {
font-size: 34rpx;
color: #333;
font-weight: bold;
margin-bottom: 6rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
}
}
}
.shop-titl {
font-size: 34rpx;
color: #333;
font-weight: bold;
margin-bottom: 6rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 100%;
}
}
}
.shopInfo-title-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #222;
background-color: $main-color;
padding: 6rpx $padding;
color: #FFF;
}
.shopInfo-title-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #222;
background-color: $main-color;
padding: 6rpx $padding;
color: #FFF;
}
}
}
}
}
.content {
height: calc(100vh - 320rpx);
background-color: #eee;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 20rpx;
box-sizing: border-box;
.content {
height: calc(100vh - 320rpx);
background-color: #eee;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 20rpx;
box-sizing: border-box;
.left {
width: 180rpx;
height: 100%;
.left {
width: 180rpx;
height: 100%;
.scroll-view-left {
height: 100%;
width: 100%;
}
.scroll-view-left {
height: 100%;
width: 100%;
}
.classify-item {
width: 100%;
padding: $padding 0;
font-size: 26rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
display: inline-block;
}
.classify-item {
width: 100%;
padding: $padding 0;
font-size: 26rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
display: inline-block;
}
.active_classify_item {
background-color: #FFFFFF;
}
}
.active_classify_item {
background-color: #FFFFFF;
}
}
.right {
width: calc(100% - 180rpx);
height: 100%;
background-color: #fff;
.right {
width: calc(100% - 180rpx);
height: 100%;
background-color: #fff;
.scroll-view-right {
width: 100%;
height: 100%;
.scroll-view-right {
width: 100%;
height: 100%;
.goods-item {
width: 100%;
display: inline-block;
border-bottom: solid 1rpx #eee;
// padding: $padding;
padding-left: $padding;
padding-top: $padding;
padding-bottom: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.goods-item {
width: 100%;
display: inline-block;
border-bottom: solid 1rpx #eee;
// padding: $padding;
padding-left: $padding;
padding-top: $padding;
padding-bottom: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.good-img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.good-img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.item--content {
flex: 1;
padding: $padding - 10;
.item--content {
flex: 1;
padding: $padding - 10;
&>.title {
font-size: 28rpx;
color: #333;
// @extend .ellipsis-1;
}
&>.title {
font-size: 28rpx;
color: #333;
// @extend .ellipsis-1;
}
&>.sub_title {
color: #a05f0c;
font-size: 24rpx;
padding-top: 4rpx;
// @extend .ellipsis-1;
}
&>.sub_title {
color: #a05f0c;
font-size: 24rpx;
padding-top: 4rpx;
// @extend .ellipsis-1;
}
&>.price {
padding-top: $padding/2;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: flex-start;
box-sizing: border-box;
line-height: 40rpx;
font-weight: bold;
font-size: 32rpx;
color: $text-price;
&>.price {
padding-top: $padding/2;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: flex-start;
box-sizing: border-box;
line-height: 40rpx;
font-weight: bold;
font-size: 32rpx;
color: $text-price;
// @extend .ellipsis-1;
.price-type {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
flex: 1;
// @extend .ellipsis-1;
.price-type {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
flex: 1;
text {
margin-right: $margin/2;
padding-left: 6rpx;
font-size: 70%;
}
text {
margin-right: $margin/2;
padding-left: 6rpx;
font-size: 70%;
}
.kucun {
color: $text-gray;
font-weight: normal;
}
}
.kucun {
color: $text-gray;
font-weight: normal;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,126 @@
<template>
<view class="groupBook">
<view class="top">
<view class="title">VIP换购</view>
<view>千款商品任意换购</view>
</view>
<!-- 有数据 -->
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
<block v-for="(item,index) in lists" :key="index">
<vipGoodsItem :item="item" @goPin="goPin" />
</block>
</scroll-view>
<!-- 没数据 -->
<scroll-view scroll-y="true" class="scroll" v-else>
<view class="vertical pages-empty" style="padding-top: 200rpx;">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/list.png"
textColor="#999"
text="暂无VIP商品~"
/>
</view>
</scroll-view>
</view>
</template>
<script>
import vipGoodsItem from '@/components/vip-goods-item/index.vue'
import {
lists
} from '@/apis/interfaces/store.js'
export default {
components: {
vipGoodsItem
},
data() {
return {
lists: [],
page: 1,
has_more: true,
};
},
onLoad() {
this.getList()
},
methods: {
getList() {
lists({
is_user:'1',
page: this.page
}).then(res => {
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true
})
})
},
// 触底获取更多~
scrolltolower() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'没有更多~',
icon:'none'
})
}
},
// 马上拼团
goPin(id) {
console.log('fule gopin....')
uni.navigateTo({
url:'/pages/store/goods?id='+id
})
}
}
}
</script>
<style lang="scss">
.groupBook {
width: 100%;
min-height: 100vh;
position: relative;
background: $window-color;
box-sizing: border-box;
position: relative;
.top {
position: absolute;
top: 0;
left: 0;
font-size: $title-size - 2;
color: #fff;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding;
box-sizing: border-box;
background: linear-gradient(to bottom, #d81e06, rgba(255, 255, 255, 0));
padding-bottom: 40vh;
z-index: 1;
.title {
font-size: 40rpx;
font-weight: bold;
}
}
.scroll {
height: 100vh;
position: relative;
padding: $padding * 4 $padding $padding $padding;
box-sizing: border-box;
z-index: 2;
}
}
</style>

View File

@@ -0,0 +1,317 @@
<template>
<view class="store-vip">
<image class="vip-bg" src="/static/store/store-vip-bg.png" mode="widthFix"/>
<swiper class="swiper" circular>
<swiper-item class="swiper-item" v-for="item in vip" :key="item.identity_id">
<view class="top">
<view class="left" v-if="vip.length > 1">
<< 滑动获取更多 </view>
<view class="content">
<!-- 四个角标 -->
<block> <image class="jiao" src="../../../../static/store/vip-left-top.png" mode="widthFix" /> <image class="jiao" src="../../../../static/store/vip-right-top.png" mode="widthFix" /> <image class="jiao" src="../../../../static/store/vip-left-bottom.png" mode="widthFix" /> <image class="jiao" src="../../../../static/store/vip-right-bottom.png" mode="widthFix" /> </block>
<view class="title1"> {{item.shop.name}} </view>
<image class="title2" :src="item.title_cover" mode="widthFix" />
<view class="title3"> {{item.description}} </view> <!-- 分类 -->
<view class="type">
<view class="type-item" v-for="it in item.rules" :key="it.order">
<image :src="it.cover" mode="aspectFill" />
<view class="title">{{it.name}}</view>
</view>
</view>
<view class="title4">---| 仅需开通 立享尊贵特权 |---</view>
</view>
<view class="right" v-if="vip.length > 1"> 滑动获取更多 >> </view>
</view>
<view class="bottom">
<view class="left">
<view class="title-1">立享尊贵特权 >> </view>
<view class="title-2" v-if="item.vip_info.ended_at"> 到期时间{{item.vip_info.ended_at}} </view>
</view>
<view class="right" @click="onOpenVip(item.identity_id)">{{item.is_vip?'立即续费':'立即开通'}} </view>
</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
import {
shopVipInfo,
shopVipCreate,
shopVipWeChat
} from '@/apis/interfaces/vip.js'
export default {
data() {
return {
vip: [],
};
},
onLoad(e) {
this.id = e.id;
this.getInfo()
},
methods: {
getInfo() {
shopVipInfo(this.id).then(res => {
uni.setNavigationBarTitle({
title: res[0].shop.name + '会员'
});
this.vip = res;
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
})
})
},
// 创建店铺vip会员
onOpenVip(identity) {
// 获取订单
uni.showLoading({
title: 'VIP会员开通中'
})
shopVipCreate(this.id,identity).then(res => {
// 支付参数
if (res.id) {
uni.showLoading({
title: '获取支付信息'
})
this.wxPay(res.id)
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 微信支付
wxPay(orderId) {
shopVipWeChat(orderId).then(orderInfo => {
uni.requestPayment({
provider: "wxpay",
orderInfo: JSON.parse(orderInfo),
success: res => {
uni.showModal({
title: '提示',
content: '开通成功',
showCancel: false,
success: () => {
uni.navigateBack({})
}
})
},
fail(err) {
let showToast = err.message
if (err.errMsg === 'requestPayment:fail [payment微信:-2]User canceled') {
showToast = '支付被取消'
}
uni.showToast({
title: showToast,
icon: 'none'
})
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask:true,
})
})
}
}
}
</script>
<style lang="scss">
.store-vip {
height: 100vh;
width: 100vw;
background-color: #f6f1eb;
position: relative;
z-index: 0;
overflow: hidden;
.vip-bg {
width: 100%;
// height: 100%;
position: absolute;
z-index: 1;
top: -50rpx;
left: -50rpx;
}
.swiper {
width: 100%;
height: 100%;
position: relative;
z-index: 2;
.swiper-item {
.top {
height: calc(100vh - 160rpx);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
.right {
font-size: 30rpx;
color: #999;
text-align: right;
width: 100%;
padding-right: 20%;
padding-bottom: 6%;
}
.left {
font-size: 30rpx;
color: #999;
text-align: left;
width: 100%;
padding-left: 20%;
padding-top: 6%;
}
.content {
padding: $padding * 2;
background-color: #fff;
border-radius: 10rpx;
width: 80%;
min-height: 70%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title1 {
font-size: 34rpx;
color: #e5c175;
font-weight: bold;
}
.title2 {
padding-top: $padding - 0;
width: 100%;
height: 0;
padding-bottom: $padding - 10;
}
.title3 {
font-size: 28rpx;
color: #2f3245;
}
.title4 {
font-size: 28rpx;
color: #e5c175;
padding-top: 30rpx;
}
.type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
flex-wrap: wrap;
margin-top: $padding * 2;
width: 100%;
.type-item {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #2f3245;
margin-bottom: 30rpx;
image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
}
}
.jiao {
width: 50rpx;
position: absolute;
}
.jiao:nth-child(1) {
left: 0;
top: 0;
}
.jiao:nth-child(2) {
right: 0;
top: 0;
}
.jiao:nth-child(3) {
left: 0;
bottom: 0;
}
.jiao:nth-child(4) {
right: 0;
bottom: 0;
}
}
}
.bottom {
height: 160rpx;
background-color: #2f3245;
color: #e5c175;
width: 100%;
display: flex;
flex-direction: row;
.left {
color: #e5c175;
width: 70%;
height: 100%;
font-weight: bold;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title-1 {
font-size: 36rpx;
}
.title-2{
font-size: 28rpx;
font-weight: normal;
}
}
.right {
background-color: #e5c175;
width: 30%;
height: 100%;
color: #2f3245;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 36rpx;
font-weight: bold;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,164 @@
<template>
<view class="pinSuccess">
<view class="count-down">
<u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss" autoStart millisecond />
</view>
<view class="title"> 还差 <span>1</span> 赶紧邀请好友来拼单吧 </view>
<view class="btn invite"> 邀请好友拼单 </view>
<view class="btn index" @click="goIndex"> 去首页逛逛</view>
<view class="goodInfo">
<view class="avatars">
<image class="avatar me" src="/static/book/333.png" mode="aspectFill" />
<image class="wen pin" src="/static/book/wen.png" mode="aspectFill" />
</view>
<view class="orderInfo">
订单详情
<view class="">
<view class="">
商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
</view>
<u-icon type="arrow-right" size="15" />
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
goIndex() {
uni.reLaunch({
url: '/pages/store/index/index'
})
}
}
}
</script>
<style lang="scss">
.pinSuccess {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.count-down {
background-color: #f9f9f9;
border-radius: 4rpx;
padding: 10rpx $padding;
margin-top: $margin;
}
.title {
font-size: 38rpx;
font-weight: bold;
margin-top: $margin * 2;
span {
color: $main-color;
font-size: 42rpx;
padding: 0 10rpx;
}
}
.btn {
width: 80%;
background-color: $main-color;
color: #fff;
text-align: center;
padding: $padding - 4;
font-size: 34rpx;
border-radius: 10rpx;
margin-top: $margin;
border: solid $main-color 3rpx;
}
.invite {
margin-top: $margin + 20;
}
.index {
background-color: rgba($color: #fff, $alpha: 1.0);
color: $main-color;
}
.goodInfo {
border-top: solid 20rpx #f9f9f9;
width: 100%;
margin-top: $margin + 20;
padding: $padding + 10;
box-sizing: border-box;
.avatars {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
border-bottom: solid 1rpx #999;
padding-bottom: $padding;
image {
width: 90rpx;
height: 90rpx;
margin: 10rpx 20rpx;
border-radius: 50%;
}
.me {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '我';
border-radius: 20rpx;
background: $main-color;
padding: 4rpx 34rpx;
text-align: center;
font-size: 24rpx;
color: #fff;
}
}
.pin {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '拼主';
border-radius: 20rpx;
background: orange;
padding: 4rpx 20rpx;
font-size: 24rpx;
color: #fff;
}
}
}
.orderInfo{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
}
}
</style>