提交细节

version/0412
fanfan 11 months ago
parent 0353e05205
commit 8668b510e5
  1. 2
      pages.json
  2. 10
      pages/activity/charts.vue
  3. 660
      pages/activity/intimate.vue
  4. 18
      pages/activity/newGoods.vue
  5. 24
      pages/activity/newPeople.vue
  6. 34
      pages/activity/newsshop.vue
  7. 37
      pages/activity/presale.vue
  8. 10
      pages/activity/ranking.vue
  9. 4
      pages/index/index.vue
  10. 31
      pages/invite/index.vue
  11. 22
      pages/news/coupon/index.vue
  12. 45
      pages/news/coupon/list.vue

@ -939,7 +939,7 @@
{ {
"path": "newsshop", "path": "newsshop",
"style": { "style": {
"navigationBarTitleText": "新年换新", "navigationBarTitleText": "活动",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }

@ -293,12 +293,12 @@
.rule { .rule {
width: 130rpx; width: 130rpx;
height: 50rpx; height: 60rpx;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
line-height: 50rpx; line-height: 60rpx;
text-align: center; text-align: center;
position: absolute; position: absolute;
right: 0; right: 0;
@ -309,16 +309,16 @@
.all { .all {
width: 130rpx; width: 130rpx;
height: 50rpx; height: 60rpx;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
line-height: 50rpx; line-height: 60rpx;
text-align: center; text-align: center;
position: absolute; position: absolute;
right: 0; right: 0;
top: 120rpx; top: 160rpx;
border-radius: 50rpx 0 0 50rpx; border-radius: 50rpx 0 0 50rpx;
z-index: 22; z-index: 22;
} }

@ -5,7 +5,9 @@
</view> </view>
<view class="intimate-hd" @click="openPage(1)"> <view class="intimate-hd" @click="openPage(1)">
<image :src="storeInfo.imageList?storeInfo.imageList[0]:''"></image> <image :src="storeInfo.imageList?storeInfo.imageList[0]:''"></image>
<view class="a">{{storeInfo.shop_name}}<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon></view> <view class="a">{{storeInfo.shop_name}}
<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
</view>
<view class="b">{{storeInfo.summary}}</view> <view class="b">{{storeInfo.summary}}</view>
</view> </view>
<!-- <scroll-view scroll-x class="intimate-menu"> <!-- <scroll-view scroll-x class="intimate-menu">
@ -17,7 +19,8 @@
<view class="intimate-bd"> <view class="intimate-bd">
<scroll-view scroll-y class="a"> <scroll-view scroll-y class="a">
<view class="item" @click="tabItem(-1)" :class="tabIndex==-1?'item-on':''">全部商品</view> <view class="item" @click="tabItem(-1)" :class="tabIndex==-1?'item-on':''">全部商品</view>
<view class="item" @click="tabItem(i)" v-for="(a,i) in list" :key="i" :class="tabIndex==i?'item-on':''">{{a.name}}</view> <view class="item" @click="tabItem(i)" v-for="(a,i) in list" :key="i" :class="tabIndex==i?'item-on':''">
{{a.name}}</view>
</scroll-view> </scroll-view>
<view class="b"> <view class="b">
<view class="t"> <view class="t">
@ -49,7 +52,7 @@
</template> </template>
<script> <script>
import * as newFunApi from '@/api/newFun' import * as newFunApi from '@/api/newFun'
export default { export default {
data() { data() {
return { return {
@ -73,14 +76,14 @@
} }
}, },
onLoad(o) { onLoad(o) {
this.tabIndex = o.index?(o.index): -1 this.tabIndex = o.index ? (o.index) : -1
this.getList(); this.getList();
this.storeInfo = uni.getStorageSync("cityInfo") this.storeInfo = uni.getStorageSync("cityInfo")
}, },
onPageScroll(e){ onPageScroll(e) {
if(e.scrollTop <= 44){ if (e.scrollTop <= 44) {
this.isScroll = true; this.isScroll = true;
}else{ } else {
this.isScroll = false; this.isScroll = false;
} }
}, },
@ -89,8 +92,12 @@
* 获取列表 * 获取列表
*/ */
async getList() { async getList() {
let {status, message, data} = await newFunApi.serverCategoryList({}); let {
if(status == 200){ status,
message,
data
} = await newFunApi.serverCategoryList({});
if (status == 200) {
this.list = data.list this.list = data.list
this.getGoodsList(); this.getGoodsList();
} }
@ -99,42 +106,50 @@
* 获取商品列表 * 获取商品列表
*/ */
async getGoodsList() { async getGoodsList() {
let {status, message, data} = await newFunApi.serverList({ let {
status,
message,
data
} = await newFunApi.serverList({
server_name: "", server_name: "",
category_id: this.tabIndex == -1?"":(this.list.length > 0?this.list[this.tabIndex].category_id:""), category_id: this.tabIndex == -1 ? "" : (this.list.length > 0 ? this.list[this.tabIndex]
order_field: this.filterIndex == 0?"server_price":this.filterIndex == 1?"line_price":this.filterIndex == 2?"sold":"", .category_id : ""),
order_sort: this.filterFlag?"desc":"asc" order_field: this.filterIndex == 0 ? "server_price" : this.filterIndex == 1 ?
"line_price" : this.filterIndex == 2 ? "sold" : "",
order_sort: this.filterFlag ? "desc" : "asc"
}); });
if(status == 200){ if (status == 200) {
data.list.map(a => { if (data.list.length > 0) {
a.server_price = Number(a.server_price); data.list.map(a => {
a.line_price = Number(a.line_price) a.server_price = Number(a.server_price);
}) a.line_price = Number(a.line_price)
this.list1 = data.list })
this.isShow = data.total == 0?true:false this.list1 = data.list
this.isShow = data.total == 0 ? true : false
}
} }
}, },
openPage(index,a){ openPage(index, a) {
if(index == 1){ if (index == 1) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/user/vip/goods" url: "/pages/user/vip/goods"
}) })
}else if(index == 2){ } else if (index == 2) {
uni.setStorageSync("getInfo",a) uni.setStorageSync("getInfo", a)
uni.navigateTo({ uni.navigateTo({
url: "/pages/news/recycling/detail?type=1" url: "/pages/news/recycling/detail?type=1"
}) })
} }
}, },
tabItem(index){ tabItem(index) {
this.tabIndex = index; this.tabIndex = index;
this.filterIndex = 0; this.filterIndex = 0;
this.getGoodsList(); this.getGoodsList();
}, },
tabFilter(index){ tabFilter(index) {
if(index == this.filterIndex){ if (index == this.filterIndex) {
this.filterFlag = !this.filterFlag this.filterFlag = !this.filterFlag
}else{ } else {
this.filterFlag = true this.filterFlag = true
} }
this.filterIndex = index; this.filterIndex = index;
@ -145,322 +160,367 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.intimate{ .intimate {
background: url(https://www.royaum.com.cn/static/news/refund-bg1.png) center top no-repeat; background: url(https://www.royaum.com.cn/static/news/refund-bg1.png) center top no-repeat;
background-size: 100% auto; background-size: 100% auto;
&-hd{
width: 686rpx; &-hd {
height: 170rpx; width: 686rpx;
background: rgba(255,255,255,0.86); height: 170rpx;
border-radius: 12rpx; background: rgba(255, 255, 255, 0.86);
margin: 0 auto; border-radius: 12rpx;
padding-top: 30rpx; margin: 0 auto;
box-sizing: border-box; padding-top: 30rpx;
margin-top: 30rpx;
position: relative;
image{
position: absolute;
width: 162rpx;
height: 162rpx;
border-radius: 162rpx;
left: 18rpx;
top: -20rpx;
}
.a{
font-size: 32rpx;
color: #212121;
margin-left: 220rpx;
}
.b{
margin-left: 220rpx;
font-size: 28rpx;
color: #646464;
margin-top: 10rpx;
}
}
&-menu{
height: 180rpx;
white-space: nowrap;
margin-top: 30rpx;
padding: 0 20rpx;
.item{
width: 150rpx;
height: 180rpx;
background: #FFFFFF;
display: inline-block;
padding: 16rpx;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #FFFFFF; margin-top: 30rpx;
text-align: center; position: relative;
margin-left: 12rpx;
border-radius: 8rpx; image {
image{ position: absolute;
width: 112rpx; width: 162rpx;
height: 112rpx; height: 162rpx;
border-radius: 162rpx;
left: 18rpx;
top: -20rpx;
} }
.p{
white-space: nowrap; .a {
overflow: hidden; font-size: 32rpx;
font-size: 28rpx; color: #212121;
font-weight: 400; margin-left: 220rpx;
color: #3F3F3F;
} }
&-on{
border: 1px solid #F21A1C; .b {
margin-left: 220rpx;
font-size: 28rpx;
color: #646464;
margin-top: 10rpx;
} }
} }
}
&-bd{ &-menu {
padding: 30rpx 0 0; height: 180rpx;
display: flex; white-space: nowrap;
height: calc(100vh - 340rpx); margin-top: 30rpx;
box-sizing: border-box; padding: 0 20rpx;
overflow: hidden;
.a{ .item {
width: 150rpx; width: 150rpx;
height: 100%; height: 180rpx;
.item{ background: #FFFFFF;
padding: 20rpx 35rpx; display: inline-block;
border-left: 3px solid #FFFFFF; padding: 16rpx;
line-height: 50rpx;
text-align: center;
font-size: 28rpx;
font-weight: 400;
color: #3F3F3F;
box-sizing: border-box; box-sizing: border-box;
&-on{ border: 1px solid #FFFFFF;
background-color: #FFFFFF; text-align: center;
border-left-color: #F34A40; margin-left: 12rpx;
border-radius: 8rpx;
image {
width: 112rpx;
height: 112rpx;
}
.p {
white-space: nowrap;
overflow: hidden;
font-size: 28rpx;
font-weight: 400;
color: #3F3F3F;
}
&-on {
border: 1px solid #F21A1C;
} }
} }
} }
.b{
width: 600rpx; &-bd {
height: 100%; padding: 30rpx 0 0;
background-color: #FFFFFF; display: flex;
.t{ height: calc(100vh - 340rpx);
display: flex; box-sizing: border-box;
align-items: center; overflow: hidden;
font-size: 28rpx;
font-weight: 400; .a {
color: #3F3F3F; width: 150rpx;
line-height: 100rpx; height: 100%;
.item{
flex: 1; .item {
padding: 20rpx 35rpx;
border-left: 3px solid #FFFFFF;
line-height: 50rpx;
text-align: center; text-align: center;
&-on{ font-size: 28rpx;
color: #F34A40; font-weight: 400;
color: #3F3F3F;
box-sizing: border-box;
&-on {
background-color: #FFFFFF;
border-left-color: #F34A40;
} }
} }
} }
.l{
height: calc(100% - 120rpx); .b {
box-sizing: border-box; width: 600rpx;
overflow: hidden; height: 100%;
.item{ background-color: #FFFFFF;
width: 270rpx;
height: 389rpx; .t {
background: #FFFFFF; display: flex;
border-radius: 7rpx; align-items: center;
opacity: 1; font-size: 28rpx;
border: 1px solid #ECECEC; font-weight: 400;
padding: 10rpx 15rpx; color: #3F3F3F;
box-sizing: border-box; line-height: 100rpx;
float: left;
margin-left: 20rpx; .item {
margin-bottom: 20rpx; flex: 1;
image{ text-align: center;
width: 230rpx;
height: 230rpx; &-on {
display: block; color: #F34A40;
margin: 0 auto; }
} }
.title{ }
padding: 10rpx 0;
line-height: 40rpx; .l {
font-size: 20rpx; height: calc(100% - 120rpx);
font-family: PingFang SC, PingFang SC; box-sizing: border-box;
font-weight: 400; overflow: hidden;
color: #1E1E1E;
text-overflow: ellipsis; .item {
white-space: nowrap; width: 270rpx;
overflow: hidden; height: 389rpx;
text{ background: #FFFFFF;
background-color: #F34A40; border-radius: 7rpx;
font-size: 20rpx; opacity: 1;
padding: 0 10rpx; border: 1px solid #ECECEC;
height: 40rpx; padding: 10rpx 15rpx;
box-sizing: border-box;
float: left;
margin-left: 20rpx;
margin-bottom: 20rpx;
image {
width: 230rpx;
height: 230rpx;
display: block;
margin: 0 auto;
}
.title {
padding: 10rpx 0;
line-height: 40rpx; line-height: 40rpx;
text-align: center; font-size: 20rpx;
border-radius: 4rpx; font-family: PingFang SC, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #1E1E1E;
margin-right: 5rpx; text-overflow: ellipsis;
display: inline-block; white-space: nowrap;
overflow: hidden;
text {
background-color: #F34A40;
font-size: 20rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 4rpx;
font-weight: 400;
color: #FFFFFF;
margin-right: 5rpx;
display: inline-block;
}
} }
}
.price{ .price {
display: flex;
align-items: center;
white-space: nowrap;
.n{
display: flex; display: flex;
align-items: baseline; align-items: center;
font-size: 11px; white-space: nowrap;
font-weight: 500;
color: #F21A1C; .n {
text{ display: flex;
font-size: 29rpx; align-items: baseline;
font-size: 11px;
font-weight: 500;
color: #F21A1C;
text {
font-size: 29rpx;
}
}
.o {
font-size: 12px;
color: #949494;
text-decoration: line-through;
} }
} }
.o{
font-size: 12px; .desc {
font-size: 10px;
font-weight: 400;
color: #949494; color: #949494;
text-decoration: line-through; white-space: nowrap;
} margin-top: 10rpx;
}
.desc{
font-size: 10px;
font-weight: 400;
color: #949494;
white-space: nowrap;
margin-top: 10rpx;
} }
}
} }
} }
} }
}
&-share{ &-share {
width: 548rpx;
height: 810rpx;
overflow: hidden;
.l{
width: 548rpx; width: 548rpx;
background: #FFFFFF; height: 810rpx;
margin: 0 auto;
overflow: hidden; overflow: hidden;
position: relative;
.a{ .l {
width: 490rpx; width: 548rpx;
height: 243rpx; background: #FFFFFF;
margin: 0 auto; margin: 0 auto;
padding-top: 24rpx;
image{
width: 100%;
height: 100%;
}
}
.b{
padding: 20rpx 20rpx;
overflow: hidden; overflow: hidden;
.item{ position: relative;
width: 220rpx;
height: 369rpx; .a {
background: #FFFFFF; width: 490rpx;
border-radius: 7rpx; height: 243rpx;
opacity: 1; margin: 0 auto;
border: 1px solid #ECECEC; padding-top: 24rpx;
padding: 10rpx 0;
box-sizing: border-box; image {
float: left; width: 100%;
margin-left: 20rpx; height: 100%;
margin-bottom: 10rpx;
image{
width: 180rpx;
height: 180rpx;
display: block;
margin: 0 auto;
} }
.title{ }
.b {
padding: 20rpx 20rpx;
overflow: hidden;
.item {
width: 220rpx;
height: 369rpx;
background: #FFFFFF;
border-radius: 7rpx;
opacity: 1;
border: 1px solid #ECECEC;
padding: 10rpx 0; padding: 10rpx 0;
line-height: 40rpx; box-sizing: border-box;
font-size: 20rpx; float: left;
font-family: PingFang SC, PingFang SC; margin-left: 20rpx;
font-weight: 400; margin-bottom: 10rpx;
color: #1E1E1E;
text-overflow: ellipsis; image {
white-space: nowrap; width: 180rpx;
overflow: hidden; height: 180rpx;
text{ display: block;
background-color: #F34A40; margin: 0 auto;
font-size: 20rpx; }
padding: 0 10rpx;
height: 40rpx; .title {
padding: 10rpx 0;
line-height: 40rpx; line-height: 40rpx;
text-align: center; font-size: 20rpx;
border-radius: 4rpx; font-family: PingFang SC, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #1E1E1E;
margin-right: 5rpx; text-overflow: ellipsis;
display: inline-block; white-space: nowrap;
overflow: hidden;
text {
background-color: #F34A40;
font-size: 20rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 4rpx;
font-weight: 400;
color: #FFFFFF;
margin-right: 5rpx;
display: inline-block;
}
} }
}
.price{ .price {
display: flex;
align-items: center;
white-space: nowrap;
padding: 0 5rpx;
.n{
display: flex; display: flex;
align-items: baseline; align-items: center;
font-size: 11px; white-space: nowrap;
font-weight: 500; padding: 0 5rpx;
color: #F21A1C;
text{ .n {
font-size: 29rpx; display: flex;
align-items: baseline;
font-size: 11px;
font-weight: 500;
color: #F21A1C;
text {
font-size: 29rpx;
}
}
.o {
font-size: 12px;
color: #949494;
text-decoration: line-through;
} }
} }
.o{
font-size: 12px; .desc {
padding: 0 5rpx;
font-size: 10px;
font-weight: 400;
color: #949494; color: #949494;
text-decoration: line-through; white-space: nowrap;
margin-top: 10rpx;
overflow: hidden;
} }
} }
.desc{
padding: 0 5rpx; }
font-size: 10px;
font-weight: 400; .c {
color: #949494; background-color: #F1F1F1;
white-space: nowrap; height: 150rpx;
margin-top: 10rpx;overflow: hidden; display: flex;
justify-content: flex-end;
align-items: center;
image {
width: 140rpx;
height: 122rpx;
margin-right: 30rpx;
} }
} }
} }
.c{
background-color: #F1F1F1; .btn {
height: 150rpx; width: 640rpx;
display: flex; line-height: 80rpx;
justify-content: flex-end; text-align: center;
align-items: center; background: #F34A40;
image{ position: fixed;
width: 140rpx; left: 50%;
height: 122rpx; margin-left: -320rpx;
margin-right: 30rpx; top: 50%;
} z-index: 2;
border-radius: 8rpx;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
margin-top: 450rpx;
} }
} }
.btn{
width: 640rpx;
line-height: 80rpx;
text-align: center;
background: #F34A40;
position: fixed;
left: 50%;
margin-left: -320rpx;
top: 50%;
z-index: 2;
border-radius: 8rpx;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
margin-top: 450rpx;
}
} }
}
</style> </style>
<style> <style>
.goods .uni-scroll-view .uni-scroll-view{ .goods .uni-scroll-view .uni-scroll-view {
overflow: auto!important; overflow: auto !important;
} }
</style> </style>

@ -59,7 +59,7 @@
}, },
backgroundImg: '', backgroundImg: '',
list:[] list: []
} }
}, },
/** /**
@ -83,10 +83,12 @@
} }
Api.brandList(pamars) Api.brandList(pamars)
.then(result => { .then(result => {
result.data.data.map(a => { if (result.data.data.length > 0) {
a.goods_price_min = Number(a.goods_price_min) result.data.data.map(a => {
}) a.goods_price_min = Number(a.goods_price_min)
app.list = result.data.data; })
app.list = result.data.data;
}
}) })
.finally(() => app.isLoading = false) .finally(() => app.isLoading = false)
}, },
@ -137,8 +139,10 @@
.topLine { .topLine {
display: flex; display: flex;
justify-content: center; justify-content: center;
.left { .left {
margin-top: 132rpx; margin-top: 132rpx;
.goodsName { .goodsName {
height: 58rpx; height: 58rpx;
font-size: 40rpx; font-size: 40rpx;
@ -206,6 +210,7 @@
background-image: url('https://www.royaum.com.cn/static/newGoods/bot.png'); background-image: url('https://www.royaum.com.cn/static/newGoods/bot.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
.goodsItem { .goodsItem {
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
@ -270,7 +275,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
max-width: 350rpx; max-width: 350rpx;
height: 88rpx; height: 88rpx;
font-size: 32rpx; font-size: 32rpx;
@ -313,6 +318,7 @@
justify-content: flex-end; justify-content: flex-end;
margin-top: 50rpx; margin-top: 50rpx;
margin-right: 30rpx; margin-right: 30rpx;
.lowPrice { .lowPrice {
height: 50rpx; height: 50rpx;
font-size: 36rpx; font-size: 36rpx;

@ -95,11 +95,13 @@
data data
} = await Api.couponList(); } = await Api.couponList();
if (status == 200) { if (status == 200) {
data.list.forEach(item => { if (data.list.length > 0) {
item.reduce_price = Number(item.reduce_price) data.list.forEach(item => {
item.min_price = Number(item.min_price) item.reduce_price = Number(item.reduce_price)
}); item.min_price = Number(item.min_price)
this.couList = data.list });
this.couList = data.list
}
} }
}, },
// //
@ -111,11 +113,13 @@
} }
Api.chartsGoodsList(pamars) Api.chartsGoodsList(pamars)
.then(result => { .then(result => {
result.data.data.map(a => { if (result.data.data.length > 0) {
a.goods_price_min = Number(a.goods_price_min); result.data.data.map(a => {
a.line_price_min = Number(a.line_price_min) a.goods_price_min = Number(a.goods_price_min);
}) a.line_price_min = Number(a.line_price_min)
app.goodList = result.data.data; })
app.goodList = result.data.data;
}
}) })
.finally(() => app.isLoading = false) .finally(() => app.isLoading = false)
}, },

@ -1,5 +1,5 @@
<template> <template>
<view class="newsshop" v-if="shopItem" :style="{backgroundImage:'url('+shopItem.index_icon+')'}"> <view class="newsshop" :style="{backgroundImage:'url('+shopItem.index_icon+')'}">
<view class="newsshop-navbar"> <view class="newsshop-navbar">
<u-navbar :title="shopItem.title" back-icon-color="#fff" :border-bottom="false" title-color="#fff" <u-navbar :title="shopItem.title" back-icon-color="#fff" :border-bottom="false" title-color="#fff"
:background="background"></u-navbar> :background="background"></u-navbar>
@ -31,6 +31,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty text="暂无活动数据显示哦~" v-else mode="list"></u-empty>
</view> </view>
</template> </template>
@ -41,11 +42,18 @@
return { return {
current: 0, current: 0,
shopItem: '', shopItem: '',
shopList: [] shopList: [],
type: 2,
} }
}, },
onLoad() { onLoad(op) {
this.getInfo() this.type = op.type ? op.type : 2
if (this.type == 2) {
this.getInfo()
}
if (this.type == 1) {
this.getShopList(op.activeid)
}
}, },
methods: { methods: {
goDetails(goodsId) { goDetails(goodsId) {
@ -64,7 +72,9 @@
// //
getInfo() { getInfo() {
const app = this; const app = this;
Api.info() Api.info({
type: 'other-item'
})
.then(result => { .then(result => {
this.shopItem = result.data; this.shopItem = result.data;
this.getShopList(result.data.id) this.getShopList(result.data.id)
@ -79,11 +89,15 @@
} }
Api.detail(pamars) Api.detail(pamars)
.then(result => { .then(result => {
result.data.col.forEach(item => { if (result.data.length>0) {
item.sliceIndex = 6; result.data.col.forEach(item => {
item.goods_price_min = Number(item.goods_price_min); item.sliceIndex = 6;
}); item.goods_price_min = Number(item.goods_price_min);
this.shopList = result.data.col.length>0?result.data.col:[]; });
this.shopList = result.data.col.length > 0 ? result.data.col : [];
}else{
this.shopList=[]
}
}) })
.finally() .finally()
}, },

@ -1,7 +1,7 @@
<template> <template>
<view class="presale"> <view class="presale">
<view class="presale-hd"> <view class="presale-hd">
<view class="rule" @click="openPage()"></view> <view class="rule" @click="openPage()">规则</view>
</view> </view>
<view class="presale-bd"> <view class="presale-bd">
<view class="tab"> <view class="tab">
@ -20,7 +20,8 @@
<view class="info"> <view class="info">
<view class="t">{{item.goods_name}}</view> <view class="t">{{item.goods_name}}</view>
<view class="d"> <view class="d">
<u-count-down :timestamp="item.end_time*1000" format="HH:mm:ss"></u-count-down><text></text> <u-count-down :timestamp="item.end_time*1000" format="HH:mm:ss"></u-count-down>
<text>后失效</text>
</view> </view>
<view class="p"> <view class="p">
<image :src="$picUrl+'/static/news/newPresale-2.png'"></image> <image :src="$picUrl+'/static/news/newPresale-2.png'"></image>
@ -58,7 +59,8 @@
methods: { methods: {
goPre(item) { goPre(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/goods/detail?goodsId=' + item.goods_id + '&isPre=' + true+'&pre_id='+this.info.id+'&isBuy='+this.info.end_time url: '/pages/goods/detail?goodsId=' + item.goods_id + '&isPre=' + true + '&pre_id=' + this.info
.id + '&isBuy=' + this.info.end_time
}) })
}, },
openPage() { openPage() {
@ -73,10 +75,12 @@
} }
Api.presaleGoodsList(pamars) Api.presaleGoodsList(pamars)
.then(result => { .then(result => {
result.data.list.map(a => { if (result.data.list.length > 0) {
a.goods_price_min = Number(a.goods_price_min); result.data.list.map(a => {
}) a.goods_price_min = Number(a.goods_price_min);
app.goodList = result.data.list; })
app.goodList = result.data.list;
}
}) })
.finally(() => app.isLoading = false) .finally(() => app.isLoading = false)
}, },
@ -93,8 +97,8 @@
const hour = now.getHours(); const hour = now.getHours();
const minute = now.getMinutes(); const minute = now.getMinutes();
const second = now.getSeconds(); const second = now.getSeconds();
let start= year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second let start = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
return (Date.parse(end.replace(/-/g, '/'))-Date.parse(start.replace(/-/g, '/'))) return (Date.parse(end.replace(/-/g, '/')) - Date.parse(start.replace(/-/g, '/')))
}, },
// //
getListCharts() { getListCharts() {
@ -138,12 +142,19 @@
height: 380rpx; height: 380rpx;
.rule { .rule {
right: 0;
top: 74rpx;
z-index: 999;
width: 100rpx; width: 100rpx;
height: 60rpx; height: 60rpx;
background-color: rgba(0, 0, 0, 0.3);
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 60rpx;
text-align: center;
position: absolute; position: absolute;
right: 0; border-radius: 50rpx 0 0 50rpx;
top: 74rpx;
z-index: 2;
} }
} }
@ -267,4 +278,4 @@
} }
} }
} }
</style> </style>

@ -148,10 +148,12 @@
} }
Api.chartsGoodsList(pamars) Api.chartsGoodsList(pamars)
.then(result => { .then(result => {
result.data.data.forEach(item => { if (result.data.data.length > 0) {
item.goods_price_min = Number(item.goods_price_min); result.data.data.forEach(item => {
}); item.goods_price_min = Number(item.goods_price_min);
app.goodList = result.data.data; });
app.goodList = result.data.data;
}
}) })
.finally(() => app.isLoading = false) .finally(() => app.isLoading = false)
}, },

@ -809,6 +809,10 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/goods/detail?goodsId=' + this.bannerList[index].redirect_url url: '/pages/goods/detail?goodsId=' + this.bannerList[index].redirect_url
}) })
} else {
uni.navigateTo({
url: '/pages/activity/newsshop?activeid=' + this.bannerList[index].id + '&type=1'
})
} }
}, },
goDetails(item) { goDetails(item) {

@ -30,28 +30,35 @@
<view class="invite-bd-b"> <view class="invite-bd-b">
<image :src="$picUrl+'/static/news/invite-bg2.png'"></image> <image :src="$picUrl+'/static/news/invite-bg2.png'"></image>
<view class="a"> <view class="a">
<view class="l"> <view class="l">
可得{{info.integral}}积分<br />{{info.coupon_name}} 可得188积分
<!-- 可得{{info.integral}}积分
<br />{{info.coupon_name}} -->
</view> </view>
<view class="l"> <view class="l">
可返现{{info.one_order_rate}}% 可返现3-5%
<!-- 可返现{{info.one_order_rate}}% -->
</view> </view>
<view class="l"> <view class="l">
{{info.one_order_rate}}{{info.coupon_name}} 新人首单礼
<!-- {{info.one_order_rate}}{{info.coupon_name}} -->
</view> </view>
</view> </view>
</view> </view>
<view class="invite-bd-c"> <view class="invite-bd-c">
<image :src="$picUrl+'/static/news/invite-bg3.png'"></image> <image :src="$picUrl+'/static/news/invite-bg3.png'"></image>
<view class="a"> <view class="a">
<view class="l"> <view class="l">
{{info.one_order_rate}}{{info.coupon_name}} 优惠券
<!-- {{info.one_order_rate}}{{info.coupon_name}} -->
</view> </view>
<view class="l"> <view class="l">
{{info.integral}}积分 积分
<!-- {{info.integral}}积分 -->
</view> </view>
<view class="l"> <view class="l">
首单返{{info.one_order_rate}}% 长期返现
<!-- 首单返{{info.one_order_rate}}% -->
</view> </view>
</view> </view>
</view> </view>

@ -1,5 +1,6 @@
<template> <template>
<view class="coupon"> <view class="coupon">
<!-- <view class="rule" @click="openPage()">规则</view> -->
<view class="coupon-hd"> <view class="coupon-hd">
<image src="https://www.royaum.com.cn/static/news/coupon-bg.jpg"></image> <image src="https://www.royaum.com.cn/static/news/coupon-bg.jpg"></image>
</view> </view>
@ -65,6 +66,11 @@
} }
}, },
openPage() {
uni.navigateTo({
url: '/pages/activity/presaleRule?type=6'
})
},
openPage() { openPage() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/news/coupon/list" url: "/pages/news/coupon/list"
@ -99,6 +105,22 @@
overflow: hidden; overflow: hidden;
min-height: 100vh; min-height: 100vh;
.rule {
right: 0;
top: 74rpx;
z-index: 999;
width: 100rpx;
height: 60rpx;
background-color: rgba(0, 0, 0, 0.3);
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 60rpx;
text-align: center;
position: absolute;
border-radius: 50rpx 0 0 50rpx;
}
.nolist { .nolist {
width: 100%; width: 100%;
display: block; display: block;

@ -5,7 +5,8 @@
:is-scroll="false" v-model="tabIndex" @change="change"></u-tabs> :is-scroll="false" v-model="tabIndex" @change="change"></u-tabs>
</view> </view>
<view class="coupon-bd"> <view class="coupon-bd">
<view class="item" :class="tabIndex == 2?'item-on':''" v-for="(item,index) in couponList" :key="index" @click="choseItem(item)" :style="{'border':item.user_coupon_id==choseId?'2rpx solid red':none}"> <view class="item" :class="tabIndex == 2?'item-on':''" v-for="(item,index) in couponList" :key="index"
@click="choseItem(item)" :style="{'border':item.user_coupon_id==choseId?'2rpx solid red':none}">
<view class="a" v-if="item.coupon_type==10"><text>{{item.reduce_price}}</text></view> <view class="a" v-if="item.coupon_type==10"><text>{{item.reduce_price}}</text></view>
<view class="a" v-if="item.coupon_type==20"><text>{{item.discount}}</text></view> <view class="a" v-if="item.coupon_type==20"><text>{{item.discount}}</text></view>
<view class="b">有效期{{item.end_time}}</view> <view class="b">有效期{{item.end_time}}</view>
@ -15,8 +16,8 @@
</view> </view>
<view class="d" v-if="tabIndex == 0" @click="goUse(item)">去使用</view> <view class="d" v-if="tabIndex == 0" @click="goUse(item)">去使用</view>
<view class="e">{{item.min_price}}元使用</view> <view class="e">{{item.min_price}}元使用</view>
<view class="f" v-if="item.coupon_type==10">{{item.min_price}}元减{{item.reduce_price}}</view> <view class="f" v-if="item.coupon_type==10">{{item.min_price}}元减{{item.reduce_price}}</view>
<view class="f" v-if="item.coupon_type==20">{{item.min_price}}{{item.discount}}</view> <view class="f" v-if="item.coupon_type==20">{{item.min_price}}{{item.discount}}</view>
<image class="bg" v-if="tabIndex <= 1" :src="$picUrl+'/static/news/icon-coupon-01.png'"></image> <image class="bg" v-if="tabIndex <= 1" :src="$picUrl+'/static/news/icon-coupon-01.png'"></image>
<image class="bg" v-else :src="$picUrl+'/static/news/icon-coupon-02.png'"></image> <image class="bg" v-else :src="$picUrl+'/static/news/icon-coupon-02.png'"></image>
<image class="icon" v-if="tabIndex == 1" :src="$picUrl+'/static/news/icon-coupon-use.png'"></image> <image class="icon" v-if="tabIndex == 1" :src="$picUrl+'/static/news/icon-coupon-use.png'"></image>
@ -39,56 +40,62 @@
export default { export default {
data() { data() {
return { return {
choseId:'', choseId: '',
list: [{ list: [{
name: '未使用', name: '未使用',
val:'isUsable' val: 'isUsable'
}, { }, {
name: '已使用', name: '已使用',
val:'isUse' val: 'isUse'
}, { }, {
name: '已过期', name: '已过期',
val:'isExpire' val: 'isExpire'
}], }],
tabIndex: 0, tabIndex: 0,
couponList:[], couponList: [],
isChose:false isChose: false
} }
}, },
onLoad(o){ onLoad(o) {
this.isChose = o.chose this.isChose = o.chose
}, },
onShow() { onShow() {
this.getCoupon(this.tabIndex) this.getCoupon(this.tabIndex)
}, },
methods: { methods: {
choseItem(item){ choseItem(item) {
if(this.isChose){ if (this.isChose) {
uni.setStorageSync('couponId',item.coupon_id) uni.setStorageSync('couponId', item.coupon_id)
uni.navigateBack() uni.navigateBack()
} }
}, },
getCoupon(e) { getCoupon(e) {
const that = this const that = this
let param={ let param = {
dataType:that.list[e].val dataType: that.list[e].val
} }
CouponApi.myCouponList(param) CouponApi.myCouponList(param)
.then(res => { .then(res => {
if (res.data.list.data.length > 0) {
res.data.list.data.forEach(item => {
item.min_price = Number(item.min_price);
item.reduce_price = Number(item.reduce_price);
});
}
that.couponList = res.data.list.data that.couponList = res.data.list.data
}) })
.finally(() => that.isLoading = false) .finally(() => that.isLoading = false)
}, },
change(e) { change(e) {
this.couponList=[] this.couponList = []
this.getCoupon(e) this.getCoupon(e)
}, },
tabItem(index) { tabItem(index) {
this.tabIndex = index this.tabIndex = index
}, },
goUse(item){ goUse(item) {
// 使 // 使
if(item.coupon_case==10){ if (item.coupon_case == 10) {
// //
uni.switchTab({ uni.switchTab({
url: "/pages/index/index" url: "/pages/index/index"
@ -241,4 +248,4 @@
} }
} }
} }
</style> </style>

Loading…
Cancel
Save