Commit d9eca4d2 by 赵雅纹

Merge branch 'dev' into feature-zyw

# Conflicts:
#	src/component/personCenter/personCenter.js
parents 57f6ff1d 6c133907
......@@ -21,6 +21,8 @@
"navigationBarTextStyle": "black"
},
"navigateToMiniProgramAppIdList": [
"wxeb490c6f9b154ef9"
"wxeb490c6f9b154ef9",
"wxcf6d299fecd830cf",
"wx5717ceb7cfa09f2e"
]
}
\ No newline at end of file
......@@ -9,6 +9,14 @@ Component({
type: Object,
value: {},
},
integralNum: {
type: Number,
value: 0,
},
couponNum: {
type: Number,
value: 0,
},
},
/**
* 页面的初始数据
......@@ -45,37 +53,6 @@ Component({
console.log(this.data.baseUrl);
},
methods: {
// 查询积分信息
getMemberPointInfo(){
console.log('getMemberPointInfo')
wx.showLoading({
title: '加载中'
})
wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
integralNum: data.point
})
}
})
},
// 查询优惠券数量
getMemberCouponInfo(){
wx.showLoading({
title: '加载中'
})
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
couponNum: data[1] || 0
})
}
})
},
toBonusDetails() {
wxService.router(`/pages/integralWater/integralWater`)
},
......
......@@ -25,7 +25,7 @@ wxService.page({
})
this.getCouponDetail(cardno)
// 条形码
wxbarcode.barcode('barcode',cardno, 550, 150);
wxbarcode.barcode('barcode', cardno, 600, 180);
},
// 查询单个优惠券
......
<!--pages/userCenter.wxml-->
<view class='page-couponDetail'>
<!--<view class='page-couponDetail'>
<view class='coupon-detail-content'>
<view class='coupon-detail-header'>
<view class='avatar-img'>
......@@ -11,11 +11,28 @@
<image src='/assets/imgs/line.png'></image>
</view>
<view class='qr-code'>
<!-- <view class='top-code'>987876786</view>-->
<view class='code-img'>
<canvas canvas-id="barcode" />
</view>
<view class='bottom-code'>{{cardno}}</view>
</view>
</view>
</view>-->
<view class="container-coupon page">
<view class="panel">
<view class="qrcode">
<view class='avatar-img'>
<image src='/assets/imgs/avatar.png'></image>
</view>
<view class='title fs-36'>{{couponDetailTitle}}</view>
</view>
<view class='line'>
<image src='/assets/imgs/line.png'></image>
</view>
<view class="barcode">
<canvas canvas-id="barcode" />
</view>
<view class='bottom-code'>{{cardno}}</view>
</view>
</view>
\ No newline at end of file
/* pages/couponDetail/couponDetail.wxss */
canvas{
height: 80px!important;
@import './../../base/base.wxss';
page {
background-color: #fff;
}
.coupon-detail-content{
width: 642rpx;
margin: 52rpx auto;
text-align: center;
box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1);
.page {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.avatar-img image{
width: 81rpx;
height: 81rpx;
margin-top: 58rpx;
.container-coupon {
padding-bottom: 10rpx;
}
.title{
color: #333333;
margin-top: 66rpx;
.panel {
width:642rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: stretch;
margin: 52rpx 60rpx;
box-sizing: border-box;
border-radius: 10rpx;
background-color: #fff;
box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1);
}
.line image{
width: 642rpx;
height: 42rpx;
margin: 80rpx 0;
.barcode {
display: flex;
height: 320rpx;
flex-direction: column;
justify-content: center;
align-items: center;
padding:0 20rpx;
box-sizing: border-box;
}
.top-code{
font-size: 24rpx;
color: #999999;
.barnum {
width: 670rpx;
height: 100rpx;
line-height: 100rpx;
font-size: 38rpx;
font-weight: bold;
text-align: center;
letter-spacing: 10rpx;
white-space: nowrap;
}
.code-img image{
.barcode > canvas {
width: 600rpx;
height: 150rpx;
height: 200rpx;
}
.code-img{
margin-top: 30rpx;
margin-left: 10px;
.qrcode {
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
}
.bottom-code{
font-size: 40rpx;
color: #05c35b;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin-top: 30rpx;
padding-bottom: 140rpx;
}
.avatar-img image{
width: 81rpx;
height: 81rpx;
margin-top: 58rpx;
}
.qr-code{
padding-bottom: 150rpx;
.title{
color: #333333;
margin-top: 66rpx;
}
.line image{
width: 100%;
height: 42rpx;
margin: 40rpx 0;
}
......@@ -47,8 +47,8 @@ wxService.page({
} else {
this.setData({
currentTab: current,
couponList: [], // 清空数据
invalidCouponList: [],
// couponList: [], // 清空数据
// invalidCouponList: [],
})
}
......@@ -85,10 +85,22 @@ wxService.page({
params = {
status: 1
}
if(pageNo == 1){
this.setData({
pageNo: 1,
couponList: [], // 清空数据
})
}
} else {
params = {
statusNot: 1
}
if(pageNo == 1){
this.setData({
invalidCouponList: [],
invalidPageNo: 1
})
}
}
wxService.post(`/coupon/coupon/listWithMember4Mina?number=${pageNo}&size=${pageSize}`, params).then(res => {
......@@ -116,7 +128,6 @@ wxService.page({
invalidTotalElements: data.totalElements
})
}
}
}).finally(() => {
......@@ -133,7 +144,6 @@ wxService.page({
onReachBottom: function () {
// 可使用 0 or 已失效 1
const { currentTab, pageNo, pageSize, totalPages, invalidPageNo,invalidTotalPages } = this.data
console.log('2222',currentTab)
if(currentTab == 0) {
if ( pageNo < totalPages) {
this.setData({
......
......@@ -57,7 +57,7 @@
<image src='/assets/imgs/qr-code.png' />
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.typeDesc}}</view>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<view class='coupon-desc fs-24'>{{item.notice}}</view>
</view>
......
......@@ -16,44 +16,15 @@ wxService.page({
render: null, // 渲染页面数据对象(安全渲染)
renderPageOver: false, // 渲染页面结束
startX: 0,
startY: 0
startY: 0,
integralNum: 0,
couponNum: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.setData(
// {
// pages: [],
// groupLoadState: 'complete', // 活动分组加载标志
// homeApiLoading: true,
// render: null, // 渲染页面数据对象(安全渲染)
// isLastPage: false, // 页面段落加载完成
// renderPageOver: false // 渲染页面结束
// },
// () => {
// // this.loadMore()
// }
// )
// handlerDataOnPage = new utils.HandlerDataOnPage()
// renderPage = require('../../utils/renderPage').getRenderPage()
// handlerDataOnPage.init(this, 'pages')
// this.initPage()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData(
{
pages: [],
......@@ -73,6 +44,54 @@ wxService.page({
this.initPage()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// 积分数量
this.getMemberPointInfo()
// 优惠券数量
this.getMemberCouponInfo()
},
// 查询积分信息
getMemberPointInfo(){
wx.showLoading({
title: '加载中'
})
wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
integralNum: data.point
})
}
})
},
// 查询优惠券数量
getMemberCouponInfo(){
wx.showLoading({
title: '加载中'
})
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
couponNum: data[1] || 0
})
}
})
},
touchStart(e) {
this.setData({
startX: e.changedTouches[0].clientX,
......
......@@ -12,7 +12,7 @@
<!-- 个人中心 {{pItem.customer}}-->
<view class="images-tab pd1530" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" />
<person-center person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}"/>
</view>
<!-- 图片导航 {{pItem.navigation.images}}-->
......
{
"description": "项目配置文件",
"packOptions": {
......@@ -15,8 +14,8 @@
"compileType": "miniprogram",
"libVersion": "2.6.6",
"appid": "wxc3b64b09b1d3dfc2",
"tempappid_wx":"wxc3b64b09b1d3dfc2",
"tempappid_711":"wx358b56af62edbde1",
"tempappid_wx": "wxc3b64b09b1d3dfc2",
"tempappid_711": "wx358b56af62edbde1",
"projectname": "7-Eleven",
"debugOptions": {
"hidedInDevtools": []
......@@ -40,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 12,
"current": 3,
"list": [
{
"id": -1,
......@@ -61,10 +60,10 @@
"query": ""
},
{
"id": 6,
"id": 3,
"name": "券码详情页",
"pathName": "pages/couponDetail/couponDetail",
"query": ""
"query": "cardno=24390355190533807720&title=新券"
},
{
"id": 7,
......
......@@ -47,7 +47,7 @@ function getAccountInfo() {
return accountInfo
}
/***
/**
* 判断用户滑动
* 左滑还是右滑
*/
......@@ -62,6 +62,26 @@ function getTouchData(endX, endY, startX, startY) {
}
/**
* 全面屏
*/
function aspectRatio(h,w) {
let viewStyle = {}
let originalScale = h/w // view宽高比
wxService.getSystemInfo().then(res=>{
let windowscale = res.windowHeight/res.windowWidth
if(originalScale < windowscale){
viewStyle.width = res.windowWidth
viewStyle.height = (res.windowWidth * h) / w;
} else {
viewStyle.width = (res.windowHeight * w) / h
viewStyle.height = res.windowHeight
}
})
return viewStyle;
}
/**
* 解析 url 参数
*/
function parseUrl(query){
......@@ -241,5 +261,6 @@ module.exports = {
formatNumber: formatNumber,
logger: new Logger(),
getTouchData,
getAccountInfo
getAccountInfo,
aspectRatio
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment