64dfaf21 by simon

版本提交

1 parent 89352d16
......@@ -22,7 +22,8 @@ App({
indexInfo: null,
userInfo: null,
wxcode: store.getItem("wxcode"),
tlMemberCode: ""
tlMemberCode: "",
curCoupon: null
},
// 获取用户基本信息
queryIndex() {
......
{
"pages": [
"pages/index/index",
"pages/register/register",
"pages/authorize/authorize",
"pages/register/register",
"pages/wish/wish",
"pages/create-wish/create-wish",
"pages/question/question",
"pages/new-welfare/new-welfare",
"pages/user-table/user-table",
"pages/coupon-detail/coupon-detail",
"pages/rank/rank",
"pages/poster/poster",
"pages/my-card/my-card",
"pages/coop/coop",
"pages/example/example",
"pages/more/more"
......
Component({
properties: {
// 这里定义了innerText属性,属性值可以在组件使用时指定
innerText: {
type: String,
value: 'default value',
}
},
data: {
// 这里是一些组件内部数据
someData: {}
},
methods: {
// 这里是一个自定义方法
customMethod() {
this.triggerEvent('evtcomp', {
name: "_evt_custom"
})
},
// 隐藏蒙层
hideMask() {
this.triggerEvent('evtcomp', {
name: "_evt_hide_product_detail_mask"
});
}
}
})
@import '../../assets/scss/mixins';
@import '../../assets/scss/utils';
.comp-item {
@extend .fcc;
.notice {
width: 439px;
height: 235px;
}
}
<view class="comp-item">
<image class="notice" mode="widthFix" src="../../image/oss/coupon-detail/cd-c3.png" />
</view>
import {
getBindtapData
} from '../../utils/util';
import Date from '../../utils/date';
let app = getApp();
Page({
data: {
userInfo: {},
used: false, //优惠券已使用,另外的样式
couponInfo: {
"couponId": "20839",
"couponCode": "RLLL1IHG",
"rule": "RLLL1IHG",
"startDate": 1564479217000,
"endDate": 1567094399000,
"type": 4,
"name": "眼部护理体验券-7月24日",
"state": 0,
"endDateStr": "19-08-29"
}
},
onShareAppMessage() {},
onLoad(options) {
app.queryIndex().then((result) => {
let couponInfo = this.data.couponInfo;
couponInfo.startDateStr = new Date(couponInfo.startDate).toString("yyyy.MM.dd");
couponInfo.endDateStr = new Date(couponInfo.endDate).toString("yyyy.MM.dd");
this.setData({
userInfo: app.globalData.userInfo,
couponInfo: couponInfo
})
this.initData();
})
},
initData() {
// this.setData({
// couponInfo: app.globalData.curCoupon
// })
},
// 查看可用门店
onNearbyStoreHandler() {
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide":
break;
default:
break;
}
},
})
{
"navigationBarTitleText": "券详情",
"usingComponents": {
"use-notice-comp": "../../component/use-notice-comp/use-notice-comp"
}
}
@import '../../assets/scss/mixins';
@import '../../assets/scss/utils';
.page {
padding-bottom: $pageBottom;
font-weight: 300;
.bgc {
background-color: #f8eeef;
}
.bg {}
.decoration {
position: relative;
.d1 {
position: absolute;
width: 92px;
height: 411px;
top: 0;
left: 0;
}
.d2 {
position: fixed;
width: 240px;
height: 181px;
right: 0;
bottom: 0;
}
.d3 {
position: absolute;
top: -20px;
right: -100px;
width: 553px;
height: 227px;
}
}
.main {
.top-space {
height: 52px;
}
.content {
position: relative;
// 奖品名
.tit {
text-align: center;
color: #bb3039;
font-size: 42px;
}
// 奖品
.prize {
position: relative;
margin: 32px auto 0;
width: 480px;
height: 642px;
.ebg {
position: absolute;
left: 0;
right: 0;
top: 0;
margin: 0 auto;
width: 480px;
height: 642px;
}
.cont {
position: relative;
.space1 {
height: 48px;
}
// 二维码
.qrcode {
width: 340px;
height: 340px;
background-color: wheat;
margin: 0 auto;
}
.code {
margin: 24px auto 0;
border-radius: 30px;
background-color: rgba($color: #f2f2f2, $alpha: 1);
@include btc(280px, 60px);
color: #666666;
font-size: 38px;
}
.info {
margin-top: 22px;
@extend .bb;
padding-left: 120px;
.c1 {
font-size: 22px;
color: #666666;
}
}
}
// 已使用
.used {
$alp: 0.3;
.qrcode {
opacity: $alp;
}
.info {
opacity: $alp;
}
}
}
// 使用说明
.use-notice {
margin-top: 28px;
}
.store-btn {
margin: 34px auto 0;
@include cb();
}
}
}
}
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<view class="decoration">
<image class="d1" src="../../image/oss/my-card/my-card-d1.png" mode="widthFix" />
<image class="d2" src="../../image/oss/my-card/my-card-d2.png" mode="widthFix" />
<image class="d3" src="../../image/oss/question/question-c1.png" mode="widthFix" />
</view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content">
<!-- 奖品名 -->
<view class="tit">· {{couponInfo.name}} ·</view>
<!-- 奖品 -->
<view class="prize">
<image class="ebg" mode="widthFix" src="../../image/oss/coupon-detail/cd-c2.png" />
<view class="cont {{used?'used':''}}">
<view class="space1"></view>
<!-- 二维码 -->
<view class="qrcode"></view>
<view class="code">{{couponInfo.couponCode}}</view>
<view class="info">
<view class="c1">手机号:{{userInfo.mobile}}</view>
<view class="c1">派券日期:{{couponInfo.startDateStr}}</view>
<view class="c1">有效日期:{{couponInfo.endDateStr}}</view>
</view>
</view>
</view>
<!-- 使用说明 -->
<view class="use-notice">
<use-notice-comp></use-notice-comp>
</view>
<!-- 查看门店 -->
<view bindtap="onNearbyStoreHandler" class="store-btn">查看可用门店</view>
</view>
</view>
</view>
......@@ -52,7 +52,7 @@ Page({
wishBillCode
} = indexInfo;
// 未登陆 出注册弹窗提示
// isCrmLogin = 1;
isCrmLogin = 1;
if (isCrmLogin == 0) {
this.setData({
tipsRegisterVisible: true
......
import {
getBindtapData
} from '../../utils/util';
let app = getApp();
Page({
data: {
prizeInfo: []
},
onShareAppMessage() {},
onLoad(options) {
this.initData();
},
initData() {
app.post({
url: app.api.fishPrize,
data: {}
}).then((result) => {
let prizeInfo = result;
prizeInfo.forEach(element => {
element.endDateStr = new Date(element.endDate).toString("yy-MM-dd");
});
this.setData({
prizeInfo: prizeInfo
})
console.log("prizeInfo:", this.data.prizeInfo);
})
},
/**
* 显示券的详情
*/
onShowDetailHandler(evt) {
let curData = getBindtapData(evt);
app.globalData.curCoupon = curData;
app.router.push({
path: "couponDetail"
})
console.log("curData:", curData);
console.log(JSON.stringify(curData));
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide":
break;
default:
break;
}
},
})
{
"navigationBarTitleText": "我的卡券"
}
@import '../../assets/scss/mixins';
@import '../../assets/scss/utils';
.page {
.bgc {
background-color: #f8eeef;
}
.bg {}
.decoration {
position: relative;
.d1 {
position: absolute;
width: 92px;
height: 411px;
top: 0;
left: 0;
}
.d2 {
position: fixed;
width: 240px;
height: 181px;
right: 0;
bottom: 0;
}
.d3 {
position: absolute;
top: -20px;
right: -100px;
width: 553px;
height: 227px;
}
}
.main {
.top-space {
height: 100px;
}
.content {
position: relative;
// 优惠券
.coupon {
position: relative;
margin-top: 18px;
&-item {
position: relative;
width: 578px;
height: 198px;
margin: 0 auto 12px;
.ebg {
left: 0;
top: 0;
position: absolute;
width: 578px;
height: 198px;
}
.cont {
position: relative;
.name {
position: absolute;
left: 40px;
top: 40px;
color: #ffffff;
font-size: 32px;
}
.detail {
position: absolute;
border-radius: 24px;
font-size: 24px;
border: solid 1px rgba($color: #ffffff, $alpha: 0.8);
color: rgba($color: #ffffff, $alpha: 0.8);
@include btc(140px, 48px);
top: 40px;
right: 26px;
}
.card-info {
position: absolute;
top: 146px;
color: #fbe4c9;
font-size: 24px;
}
.card-no {
left: 28px;
}
.card-date {
right: 28px;
}
}
}
&-item2 {
.name {
color: #653d0d;
}
.card-info {
color: #fce6c2;
}
}
}
}
.store-btn {
position: absolute;
top: 24px;
right: 0;
@include border-left-radius(30px);
@include btc(220px, 60px);
font-size: 30px;
color: #bf0221;
box-shadow: 7.4px 8.2px 27px 0 rgba(228, 78, 96, 0.86);
background-image: linear-gradient(to right, #fbddd5, #f9efed 51%, #ffded9 99%), linear-gradient(to bottom, #000000, #000000);
.c1 {
padding-left: 12px;
}
}
}
}
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<view class="decoration">
<image class="d1" src="../../image/oss/my-card/my-card-d1.png" mode="widthFix" />
<image class="d2" src="../../image/oss/my-card/my-card-d2.png" mode="widthFix" />
<image class="d3" src="../../image/oss/question/question-c1.png" mode="widthFix" />
</view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content">
<view class="coupon">
<view wx:for="{{prizeInfo}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
<image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" />
<view class="cont">
<view class="name">{{item.name}}</view>
<view bindtap="onShowDetailHandler" data-data="{{item}}" class="detail">查看详情</view>
<view class="card-info card-no">劵码:{{item.couponCode}}</view>
<view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
</view>
</view>
</view>
</view>
<view class="store-btn" bindtap="onNearbyStoreHandler">
<span class="c1">附近门店查询</span>
</view>
</view>
</view>
......@@ -177,8 +177,10 @@
// 优惠券
.coupon {
width: 578px;
position: relative;
margin-top: 18px;
// margin: 18px;
margin: 0 auto;
&-item {
position: relative;
......@@ -202,7 +204,7 @@
left: 40px;
top: 40px;
color: #ffffff;
font-size: 34px;
font-size: 32px;
}
.detail {
......
......@@ -51,15 +51,6 @@
<view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
</view>
</view>
<!-- <view class="coupon-item coupon-item2">
<image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
<view class="cont">
<view class="name">眼部保养劵</view>
<view class="detail">查看详情</view>
<view class="card-info card-no">劵码:ABCD 1234</view>
<view class="card-info card-date">有效期:即日起至19.10.31</view>
</view>
</view> -->
</view>
</view>
<view bindtap="onCreateWishHandler" class="create-wish-btn">去创建心愿单</view>
......
......@@ -23,7 +23,7 @@
}
.d2 {
position: fixed;
position: absolute;
width: 145px;
height: 368px;
right: 0;
......
......@@ -25,6 +25,12 @@ Page({
tipsRuleVisible: true
})
},
// 显示我的卡券
onMyCardHandler() {
app.router.push({
path: "myCard"
})
},
// 显示海报图
onCreatePosterHandler() {
app.router.push({
......
......@@ -39,7 +39,7 @@
<span class="t1">{{item.elasticValue}}</span>
弹力值!
</view>
<view class="empty" wx:if="{{helperInfo.helpers.length <= 0}}">这里空空如也~</view>
<view class="empty" wx:if="{{helperInfo.helpers.length <= 0}}">还没有好友助力,马上让她们帮你实现愿望吧!</view>
</scroll-view>
</view>
<view class="btn-wrap">
......
......@@ -6,6 +6,8 @@ const routerPath = {
userTable: '/pages/user-table/user-table', // 用户表单
rank: '/pages/rank/rank', // 排行榜
poster: '/pages/poster/poster', // 海报页
myCard: '/pages/my-card/my-card', // 我的卡券
couponDetail: '/pages/coupon-detail/coupon-detail', // 券详情
coop: '/pages/coop/coop', // 协作页/好友查看
register: '/pages/register/register', // 注册
authorize: '/pages/authorize/authorize', // 授权
......