[最新代码]

This commit is contained in:
zhangjing
2021-06-25 10:11:46 +08:00
parent b555234d49
commit aacd11356b
29 changed files with 199 additions and 42 deletions

View File

@@ -4,7 +4,10 @@ import {updToken} from './updateToken'
// 请求方式配置 // 请求方式配置
// https://lifetest.ysd-bs.com //测试地址 // https://lifetest.ysd-bs.com //测试地址
// https://card.ysd-bs.com // https://card.ysd-bs.com
const api = "https://lifetest.ysd-bs.com/api/" //正式地址
// wx8e424dbdc443381f 测试appid
// wxb2e3e8091d9feac3 正式appid
const api = "https://card.ysd-bs.com/api/" //正式地址
const header = { const header = {
"Accept" : "application/json" "Accept" : "application/json"
} }

View File

@@ -39,7 +39,6 @@ Page({
}, },
onShow() { onShow() {
console.log(this.data.screenChannel)
// 获取账变记录 // 获取账变记录
this.accountInfo(); this.accountInfo();
}, },

View File

@@ -33,7 +33,6 @@ Page({
*/ */
frozenInfo() { frozenInfo() {
wx.$api.user.ungrants(this.data.type).then(res=>{ wx.$api.user.ungrants(this.data.type).then(res=>{
console.log(res)
this.setData({ this.setData({
frozenData: res.data frozenData: res.data
}) })

View File

@@ -36,7 +36,7 @@
<view class="grantTop"> <view class="grantTop">
<image class="grantTop-img" src="/static/img/frozen_back.png" mode="scaleToFill"></image> <image class="grantTop-img" src="/static/img/frozen_back.png" mode="scaleToFill"></image>
<view class="grantTop-text"> <view class="grantTop-text">
<image src="/static/img/frozen_identity_00.png"></image> <image src="{{type == 'silver' ? '/static/img/frozen_identity_00.png' : '/static/img/frozen_identity_01.png'}}"></image>
<view class="grantTop-price"> <view class="grantTop-price">
<text>待发放(额度)</text> <text>待发放(额度)</text>
<view class="grantTop-price-tips">¥</view>{{item.ungrant}} <view class="grantTop-price-tips">¥</view>{{item.ungrant}}
@@ -57,11 +57,14 @@
<view class="grantIssue-title-name"> <view class="grantIssue-title-name">
<image src="/static/img/frozen_icon.png"></image><text>消费红包分期发放</text> <image src="/static/img/frozen_icon.png"></image><text>消费红包分期发放</text>
</view> </view>
<view class="grantIssue-title-tips">应发余额<text>¥{{item.variable}}</text>,发放期数<text> {{item.num}} <view class="grantIssue-title-tips">
</text>期,每期发放<text>¥{{item.avg}}/期</text></view> 应发余额<text>¥{{item.variable}}</text>,发放期数<text>{{item.num}}</text>期,每期发放<text>¥{{item.avg}}/期</text>
</view>
</view> </view>
<view class="grantIssue-list"> <view class="grantIssue-list">
<view class="grantIssue-label" wx:for="{{item.items}}" wx:for-item="listItem" wx:key="items"> <block wx:if="{{item.items.length > 0}}">
<view class="grantIssue-label" wx:for="{{item.items}}" wx:for-item="listItem"
wx:key="items">
<image class="grantIssue-label-img {{listItem.status == 0 ? 'active' : ''}}" <image class="grantIssue-label-img {{listItem.status == 0 ? 'active' : ''}}"
src="/static/img/frozen_img.png" mode="scaleToFill"></image> src="/static/img/frozen_img.png" mode="scaleToFill"></image>
<view class="grantIssue-label-cont"> <view class="grantIssue-label-cont">
@@ -73,7 +76,8 @@
</view> </view>
<view class="grantIssue-label-center"> <view class="grantIssue-label-center">
<view class="grantIssue-center-top {{listItem.status == 0 ? 'active' : ''}}"> <view class="grantIssue-center-top {{listItem.status == 0 ? 'active' : ''}}">
<text>{{listItem.variable}}</text>( 发放额度 )</view> <text>{{listItem.variable}}</text>( 发放额度 )
</view>
<view class="grantIssue-center-time">发放时间:{{listItem.start_at}}</view> <view class="grantIssue-center-time">发放时间:{{listItem.start_at}}</view>
</view> </view>
<view class="grantIssue-label-right {{listItem.status == 0 ? 'active' : ''}}"> <view class="grantIssue-label-right {{listItem.status == 0 ? 'active' : ''}}">
@@ -84,6 +88,12 @@
src="/static/img/frozen_btn.png" mode="scaleToFill"> src="/static/img/frozen_btn.png" mode="scaleToFill">
</image> </image>
</view> </view>
</block>
<!-- 暂无内容 -->
<view class="grantIssue-pack" wx:else>
<image src="/static/img/Account_icon_tips.png"></image>
<view>抱歉,目前发放期数~</view>
</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
@@ -109,6 +119,7 @@
</view> </view>
</view> </view>
<!-- 暂无内容 --> <!-- 暂无内容 -->
<view class="pack-center pages-hint" wx:else> <view class="no-pack-center pack-center pages-hint" wx:else>
<image src="/static/img/Account_icon.png"></image>
<view>抱歉,目前暂无内容~</view> <view>抱歉,目前暂无内容~</view>
</view> </view>

View File

@@ -103,11 +103,11 @@
/* 最新样式 2021-06-22 */ /* 最新样式 2021-06-22 */
page, page,
.pack-center { .no-pack-center {
background-image: linear-gradient(to bottom, #24315d, #24315d); background-image: linear-gradient(to bottom, #24315d, #24315d);
} }
.pack-center { .no-pack-center {
color: #fff; color: #fff;
} }
@@ -480,5 +480,21 @@ page,
.dots .active { .dots .active {
width: 24rpx; width: 24rpx;
border-radius: 40rpx; border-radius: 40rpx;
background-color: #b13509; background-color: #ffdf95;
}
.grantIssue-pack {
background: rgba(0, 0, 0, .2);
border-radius: 10rpx;
text-align: center;
padding: 40rpx 0;
color: #c9d3f7;
font-weight: 600;
font-size: 30rpx;
}
.grantIssue-pack image {
width: 200rpx;
height: 200rpx;
margin-bottom: 20rpx;
} }

View File

@@ -26,6 +26,7 @@ Page({
isUser : false, //用户登录状态 isUser : false, //用户登录状态
noticeData : '', //首页公告 noticeData : '', //首页公告
loading : true, //骨架屏加载 loading : true, //骨架屏加载
subState : '', //订阅状态
address : { address : {
city: "", //市 city: "", //市
area: "", //区 area: "", //区
@@ -70,13 +71,13 @@ Page({
indexInfo() { indexInfo() {
if(this.data.stateType == 'shaky') { if(this.data.stateType == 'shaky') {
wx.$api.index.index(this.data.city, this.data.longitude, this.data.latitude).then(res=>{ wx.$api.index.index(this.data.city, this.data.longitude, this.data.latitude).then(res=>{
console.log(res.data.adverts)
this.setData({ this.setData({
adverts : res.data.adverts, adverts : res.data.adverts,
cardArr : res.data.rights, cardArr : res.data.rights,
activities : res.data.activities, activities : res.data.activities,
noticeData : res.data.notice, noticeData : res.data.notice,
loading : false, loading : false,
subState :res.data.welfare_subscribe,
address : { address : {
city: res.data.location.city_name, city: res.data.location.city_name,
area: res.data.location.district_name || "", area: res.data.location.district_name || "",
@@ -96,7 +97,6 @@ Page({
}) })
} else { } else {
wx.$api.index.choice(this.data.stateType,this.data.city, this.data.longitude, this.data.latitude).then(res=>{ wx.$api.index.choice(this.data.stateType,this.data.city, this.data.longitude, this.data.latitude).then(res=>{
console.log(res.data.adverts)
this.setData({ this.setData({
adverts : res.data.adverts, adverts : res.data.adverts,
cardArr : res.data.categorys, cardArr : res.data.categorys,
@@ -171,7 +171,6 @@ Page({
* 点击轮播图片 * 点击轮播图片
*/ */
clickImg(e) { clickImg(e) {
console.log(e.currentTarget.dataset)
let newChannel = e.currentTarget.dataset.channel, let newChannel = e.currentTarget.dataset.channel,
newImg = e.currentTarget.dataset.img, newImg = e.currentTarget.dataset.img,
newUrl = e.currentTarget.dataset.url newUrl = e.currentTarget.dataset.url
@@ -325,8 +324,15 @@ Page({
* 订阅 * 订阅
*/ */
subscribeTap() { subscribeTap() {
if(!this.data.isUser) {
// 去登录
wx.navigateTo({
url: "/pages/login/login"
})
return
}
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['g8cEL-Tf2_Pdh8VyBdsYbhv09VVm8om-ZblhXIaVDiY'], tmplIds: ['6SJqWbasj42O_d7yET1s5G1eg62Z4SS3pByBeuXekSo'],
success: res=> { success: res=> {
if(res.errMsg == "requestSubscribeMessage:ok") { if(res.errMsg == "requestSubscribeMessage:ok") {
wx.$api.index.subscribe(1).then(res=>{ wx.$api.index.subscribe(1).then(res=>{
@@ -334,9 +340,14 @@ Page({
title: res.data, title: res.data,
icon : 'none', icon : 'none',
}) })
// 获取卡权益
this.indexInfo();
setTimeout(function () { setTimeout(function () {
wx.hideLoading(); wx.hideLoading();
}, 1000) }, 1000)
}).catch(err=>{ }).catch(err=>{
}) })

View File

@@ -86,7 +86,6 @@
<image class="welfare_stra" src="../../static/img/welfare_stra.png"></image> <image class="welfare_stra" src="../../static/img/welfare_stra.png"></image>
<image class="welfare-title" src="../../static/img/welfare_title.png"></image> <image class="welfare-title" src="../../static/img/welfare_title.png"></image>
</view> </view>
<view class="subscribe" bindtap="subscribeTap">点击消息提醒</view>
<view class="WelfareTitle"><text>{{ activities.length }}</text> 大会员权益,福利全线升级</view> <view class="WelfareTitle"><text>{{ activities.length }}</text> 大会员权益,福利全线升级</view>
<view class="WelfareList" bindtap="Snapup" wx:for="{{activities}}" wx:key="activities" <view class="WelfareList" bindtap="Snapup" wx:for="{{activities}}" wx:key="activities"
data-text="{{item.code_text}}" data-can="{{item.canBuy}}" data-id="{{item.welfare_id}}" data-text="{{item.code_text}}" data-can="{{item.canBuy}}" data-id="{{item.welfare_id}}"
@@ -114,6 +113,13 @@
</view> </view>
</view> </view>
</view> </view>
<view class="subscribe" bindtap="subscribeTap" wx:if="{{!subState}}">
<view class="subscribe-icon">
<image class="subscribe-icon-one" src="/static/img/finger_00.png"></image>
<image class="subscribe-icon-two" src="/static/img/finger_01.png"></image>
</view>
<view class="subscribe-cont"><text>点击消息提醒</text></view>
</view>
</view> </view>
</view> </view>

View File

@@ -573,5 +573,116 @@ page {
/* 订阅消息 */ /* 订阅消息 */
.subscribe { .subscribe {
color: #fff; color: #89663f;
width: 100%;
padding: 0 100rpx;
display: inline-block;
box-sizing: border-box;
margin-top: 50rpx;
display: flex;
/* -webkit-animation: Tada 3s both infinite;
-moz-animation: Tada 3s both infinite;
-ms-animation: Tada 3s both infinite;
animation: Tada 3s both infinite; */
}
.subscribe-icon,
.subscribe-cont {
height: 80rpx;
text-align: center;
line-height: 80rpx;
position: relative;
}
.subscribe-icon {
width: 150rpx;
padding-left: 30rpx;
box-sizing: border-box;
background: linear-gradient(to right, #f3c988, #f9e0b8);
border-radius: 40rpx 0 0 40rpx;
}
.subscribe-icon::after{
position: absolute;
content: '';
right: -50rpx;
top: 0;
width: 0;
height: 0;
border-bottom: 80rpx solid #f9e0b8;
border-right: 50rpx solid transparent;
z-index: 9;
}
.subscribe-cont {
width: calc(100% - 150rpx);
background: linear-gradient(to right, #f3c988, #f9e0b8);
border-radius: 0 40rpx 40rpx 0;
font-weight: 600;
}
.subscribe-cont text {
display: inline-block;
-webkit-animation: subscribeCont 1s linear infinite;
animation: subscribeCont 1s linear infinite;
}
@keyframes subscribeCont {
25% {transform: scale(.98);}
50%, 100% {transform: scale(1);}
75% {transform: scale(1.05);}
}
.subscribe-icon image {
width: 54rpx;
height: 54rpx;
margin-top: 14rpx;
}
@keyframes Tada {
0% {
transform: scale(1);
transform: scale(1)
}
70%,73%{
transform: scale(1) rotate(-3deg);
transform: scale(1) rotate(-3deg)
}
77%,83%,90%,97% {
transform: scale(1) rotate(3deg);
transform: scale(1) rotate(3deg)
}
80%,87%,93%{
transform: scale(1) rotate(-3deg);
transform: scale(1) rotate(-3deg)
}
100% {
transform: scale(1) rotate(0);
transform: scale(1) rotate(0)
}
}
.subscribe-icon-one {
-webkit-animation: bounce-right 1s linear infinite;
animation: bounce-right 1s linear infinite;
}
@keyframes bounce-right {
25% {transform: translateX(-3px);}
50%, 100% {transform: translateX(0);}
75% {transform: translateX(3px);}
}
.subscribe-icon-two {
-webkit-animation: bounce-two 1s linear infinite;
animation: bounce-two 1s linear infinite;
}
@keyframes bounce-two {
25% {opacity: 0;transform: translateX(-3px);}
75% {opacity: 1;transform: translateX(3px);}
} }

View File

@@ -21,7 +21,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
console.log(options)
this.setData({ this.setData({
businessId: options.business_id businessId: options.business_id
}) })

View File

@@ -160,6 +160,10 @@
font-size: 36rpx; font-size: 36rpx;
} }
.userCard-parice text {
font-size: 28rpx;
}
.userCard-arrow-left, .userCard-arrow-right { .userCard-arrow-left, .userCard-arrow-right {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;

View File

@@ -12,7 +12,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
console.log(options.url)
this.setData({ this.setData({
url : decodeURIComponent(options.url) url : decodeURIComponent(options.url)
}) })

View File

@@ -23,14 +23,13 @@
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": true, "useApiHostProcess": false,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"enableEngineNative": false, "enableEngineNative": false,
"bundle": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": true, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
@@ -41,7 +40,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.12.1", "libVersion": "2.12.1",
"appid": "wx8e424dbdc443381f", "appid": "wxb2e3e8091d9feac3",
"projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3%EF%BC%88%E6%B5%8B%E8%AF%95%EF%BC%89", "projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3%EF%BC%88%E6%B5%8B%E8%AF%95%EF%BC%89",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []

BIN
static/img/Account_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/finger_00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

BIN
static/img/finger_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 282 KiB