Commit a770f5e2 by 高淑倩

add: 集点进度_图片

parent 97ce453b
// component/progressImage/progressImage.js
const wxService = require('../../utils/wxService')
Component({
properties: {
goal: {
type: Number,
value: 0
},
showNum: {
type: Boolean,
value: false
},
AvailableNum: {
type: Number,
value: 0
},
showRemNum: {
type: Number,
value: 0
},
iconImage: {
type: String,
value: ''
},
iconImageFinsh: {
type: String,
value: ''
}
},
/**
* 页面的初始数据
*/
data: {
num: 5,
currentProgress: 0, // 当前已完成进度
},
attached() {},
observers: {
AvailableNum() {
wxService.nextTick(()=>{
const { AvailableNum, showRemNum,goal, showNum } = this.data
this.setData({
currentProgress: AvailableNum ? (showNum ? goal : showRemNum) : showRemNum
})
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<!--component/progressImage/progressImage.wxml-->
<view class="section clearfix">
<view class="{{goal >=7 ? '' : 'text-section'}}">
<!-- 当前已完成 -->
<block wx:for="{{currentProgress}}" wx:key="{{index}}">
<view class="text-item" style="width: {{100 / 8}}%;">
<!--<image class="item-img" style="" src="/assets/imgs/point/color.png" mode="widthFix" />-->
<image class="item-img computed" style="" src="{{iconImageFinsh}}" mode="widthFix" />
</view>
</block>
<!-- 当前目标进度 未完成 -->
<block wx:for="{{goal - currentProgress}}" wx:key="{{index}}">
<view class="text-item" style="width: {{100 / 8}}%;">
<image class="item-img undone" style="" src="{{iconImage}}" mode="widthFix" />
</view>
</block>
</view>
</view>
\ No newline at end of file
/* component/progressImage/progressImage.wxss */
.text-section {
text-align: center;
display: flex;
justify-content: center;
}
.text-item {
float: left;
height: 82rpx;
line-height: 82rpx;
margin:0 10rpx 10rpx 0;
box-sizing: content-box;
border-radius: 50%;
}
.item-img {
height: 82rpx;
width: 100%;
border-radius: 50%;
}
.computed {
border: 1rpx dashed #FFF;
}
.undone {
border: 1rpx dashed #ccc;
}
.clearfix::after {
content: '';
display: block;
clear: both; }
\ No newline at end of file
......@@ -21,6 +21,8 @@ wxService.page({
type: 0, // 0 不显示 1 显示
popupType: 0, // 默认不跳转 1 优惠券 2 积分
goal: 0,
iconImage: '',
iconImageFinsh: '',
detailImage: '',
countObj: {
surplusPoints: 0,
......@@ -78,6 +80,8 @@ wxService.page({
currentStatus: data.status,
popupType: data.popupType,
goal: data.goal,
iconImage: data.iconImage,
iconImageFinsh: data.iconImageFinsh,
desc: JSON.parse(data.content),
detailImage: data.detailImage,
dialog,
......
......@@ -3,6 +3,7 @@
"usingComponents": {
"status-img": "/component/statusPoint/statusPoint",
"x-dialog":"/component/dialog/dialog",
"x-progress-point":"/component/progressPoint/progressPoint"
"x-progress-point":"/component/progressPoint/progressPoint",
"x-progress-image":"/component/progressImage/progressImage"
}
}
\ No newline at end of file
......@@ -21,12 +21,13 @@
</view>
</view>
<view class="info-progress border_box">
<x-progress-point
<!-- <x-progress-point
active-color='#3EEB9A, #04C25C'
percent='{{currentPercent != null ? currentPercent : 0}}'
stroke-width='20'
radius='20'
/>
/>-->
<x-progress-image goal="{{goal}}" iconImageFinsh="{{iconImageFinsh}}" iconImage="{{iconImage}}" AvailableNum="{{countObj.surplusExchangeCount}}" showRemNum="{{countObj.totalPoints ? tools.parse(countObj.totalPoints % goal) : 0}}" showNum="{{tools.parse(countObj.totalPoints % goal) == 0}}"/>
</view>
<!-- 活动剩余点数 >= 目标点数 wx:if="{{countObj.surplusPoints >= goal}}"-->
<button
......
......@@ -21,7 +21,7 @@
font-family: PingFangSC-Regular;
}
.info-progress{
padding: 31rpx 0 56rpx 0;
padding: 31rpx 0 56rpx 15rpx;
}
.info-status-btn {
margin: 0 50rpx;
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 17,
"current": 15,
"list": [
{
"id": -1,
......@@ -137,7 +137,7 @@
"id": 15,
"name": "pages/pointDetail/pointDetail",
"pathName": "pages/pointDetail/pointDetail",
"query": "id=610436124833353728",
"query": "id=611943773647278080",
"scene": null
},
{
......
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