Commit 231f4926 by zhangzhen

功能优化

parent f817742f
......@@ -57,6 +57,11 @@ export const equityDuration=(data)=>{
return http.get(url,data)
}
export const equityDurationList=(data)=>{
let url=`/durationLog/list`
return http.get(url,data)
}
export const monthlyCardConf=(data)=>{
let url=`/monthlyCardConf/query`
......
......@@ -284,6 +284,14 @@
"navigationBarTitleText": "我的卡包",
"enablePullDownRefresh" : false
}
},
{
"path" : "publicize/index",
"style" :
{
"navigationBarTitleText": "邀请好友注册",
"enablePullDownRefresh" : false
}
}
]
}
......
......@@ -47,8 +47,8 @@
</view>
</view>
</view>
<view class="banner2">
<image :src="assetsPath +'/banner4.png'" mode="widthFix"></image>
<view class="banner2" @tap="onNavToPublicize">
<image :src="assetsPath +'/banner5.png'" mode="widthFix"></image>
</view>
<view class="flex-col list-box">
<!-- <view class="title titleStyle">
......@@ -765,6 +765,11 @@
}
})
},
onNavToPublicize(){
uni.navigateTo({
url:'/setting/publicize/index'
})
},
onPreview(val) {
uni.previewImage({
current: 0,
......
......@@ -596,7 +596,8 @@
secondaryCard:{
status: 0,
number: 0
}
},
submitBtnStatus:false
};
},
filters: {
......@@ -1510,6 +1511,7 @@
},
onCancle() {
this.$refs.confirmPop.close();
this.submitBtnStatus = false
},
onOrderConfirmBefore() {
if(this.formatAllData.useStatus){
......@@ -1519,6 +1521,11 @@
})
return;
}
if(this.submitBtnStatus) return
this.submitBtnStatus = true;
wx.requestSubscribeMessage({
tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
......@@ -1537,6 +1544,7 @@
icon: "none",
title: '当前房间维护中,无法预定,请选择其他房间'
})
this.submitBtnStatus = false;
return;
}
// if(this.roomInfo.isDirtyRoom >=1){
......@@ -1554,6 +1562,7 @@
icon: "none",
title: "当前时间晚于预约开始时间,请重新选择预约时间"
})
this.submitBtnStatus = false;
return
}
......@@ -1562,6 +1571,7 @@
icon: "none",
title: "所选时段已被其他订单占用"
})
this.submitBtnStatus = false;
return
}
......@@ -1646,7 +1656,7 @@
orderCancelPay({
orderNo: res.data.data.orderNo
}).then(res => {
this.submitBtnStatus = false
})
},
"complete": (resp) => {
......@@ -1679,6 +1689,7 @@
// setTimeout(()=>{
// this.onGetSortDistance()
// },2000)
this.submitBtnStatus = false
}
})
}
......
<template>
<view class="flex-col">
<view class="flex-between header-content">
<view class="logo">
<image class="logo-bg" :src="assetsPath +'/publicize/logo.png'" mode="widthFix"></image>
</view>
<view class="btn-box">
<button class="cu-btn">
活动规则
</button>
</view>
</view>
<view class="banner">
<image class="banner-bg" :src="assetsPath +'/publicize/banner.png'" mode="widthFix"></image>
</view>
<view class="option-btn">
<button open-type="share" class="cu-btn flex-row-center part-left">
<image class="wechat-icon" :src="assetsPath +'/publicize/wechat_icon.png'" mode="widthFix"></image>
<text>微信好友</text>
</button>
<button class="cu-btn flex-row-center part-right" @tap="onShareByQrcode">
<image class="wechat-icon" :src="assetsPath +'/publicize/pic_icon.png'" mode="widthFix"></image>
<text>生成图片</text>
</button>
</view>
<view class="process">
<view class="divider">
<u-divider text="参加步骤" line-color="#333333" text-color="#000000"></u-divider>
</view>
<view class="flex-row margin-top-sm">
<view class="flex-1 flex-col item">
<view class="flex-row-center">
<image class="icon" :src="assetsPath +'/publicize/icon_1.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
<text>分享链接</text>
<text>给好友</text>
</view>
</view>
<view class="flex-col item">
<view class="flex-row-center">
<image class="icon2" :src="assetsPath +'/publicize/jt_right.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
</view>
</view>
<view class="flex-1 flex-col item">
<view class="flex-row-center">
<image class="icon" :src="assetsPath +'/publicize/icon_2.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
<text>好友注册</text>
</view>
</view>
<view class="flex-col item">
<view class="flex-row-center">
<image class="icon2" :src="assetsPath +'/publicize/jt_right.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
</view>
</view>
<view class="flex-1 flex-col item">
<view class="flex-row-center">
<image class="icon" :src="assetsPath +'/publicize/icon_3.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
<text>好友完成</text>
<text>首单</text>
</view>
</view>
<view class="flex-col item">
<view class="flex-row-center">
<image class="icon2" :src="assetsPath +'/publicize/jt_right.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
</view>
</view>
<view class="flex-1 flex-col item">
<view class="flex-row-center">
<image class="icon" :src="assetsPath +'/publicize/icon_4.png'" mode="widthFix"></image>
</view>
<view class="flex-col">
<text>邀请达成,</text>
<text>获取奖励!</text>
</view>
</view>
</view>
</view>
<view class="process">
<view class="divider">
<u-divider text="我的成就" line-color="#333333" text-color="#000000"></u-divider>
</view>
<view class="flex-row-center">
<view class="flex-1 flex-col item2">
<text class="text-title">已成功邀请</text>
<view class="flex-row-center">
<text class="text-1">{{countNum}}</text>
<text class="text-2"></text>
</view>
</view>
<view class="flex-1 flex-col item2">
<text class="text-title">已获得奖励</text>
<view class="flex-row-center">
<text class="text-1">{{countDuration}}</text>
<text class="text-2">小时</text>
</view>
</view>
</view>
</view>
<view class="process2">
<view class="divider">
<u-divider text="邀请记录" line-color="#333333" text-color="#000000"></u-divider>
</view>
<view class="list-box">
<scroll-view scroll-y="true" @scrolltolower="onScrolltolower" class="scroll-view">
<view class="flex-col list-box">
<view v-for="(item,i) in list" :key="i" class="flex-between item">
<view class="flex-col">
<text class="text-gray">入账时间 {{item.createTime}}</text>
<view class="flex-row-center">
<text class="text-gray margin-right-sm">奖励来源</text>
<text class="text-black">好友「凑角用户 1001」注册成功</text>
</view>
</view>
<view class="time-box">
<text class="text-red">+{{item.variableDuration}}小时</text>
</view>
</view>
<view v-if="list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
</view>
</scroll-view>
<view v-if="loginStatus && !list.length" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120" :icon="listBlankImage">
</u-empty>
</view>
</view>
</view>
<uni-popup ref="popupShare" type="center">
<view class="popup-box-content popup-box-share">
<view class="popup-box popup-box-2">
<view class="close-box" @tap="onClose">
<text class="cuIcon-close text-xl text-icon"></text>
</view>
<view class="title-header">
<text class="text-title text-black text-lg text-bold">分享邀请</text>
</view>
<view class="flex-col popup-content">
<view class="share-qrcode">
<view class="qrcode-box">
<tki-qrcode ref="qrcode" :cid="cid" :val="text" :size="size" unit="upx"
icon="../../static/logo_icon.png" :iconSize="iconSize" :onval="true" :loadMake="loadMake"
:showLoading="true" @result="qrR" />
</view>
<view class="part-bottom">
<button class="btn cu-btn bg-white" @tap="onSaveImg">
<image src="../../static/icon_album.png" mode="widthFix"></image>
<text>保存到相册</text>
</button>
<button open-type="share" class="btn cu-btn bg-blue">
<image src="../../static/share_icon_2.png" mode="widthFix"></image>
<text>分享邀请</text>
</button>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<LoginPop ref="loginPop" @success="onGetUserInfo" />
</view>
</template>
<script>
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode";
import LoginPop from "@/components/login/login";
import config from "@/config/index.config";
import {
equityBindUser,
equityDuration,
equityDurationList
} from "@/api/recharge.js"
import {
getUserInfo
} from "@/api/index.js"
export default {
data() {
return {
cid: "qrCode",
qrPath: '',
text: '生成中',
size: 520,
iconSize: 52,
colorDark: '#000000',
loadMake: false,
qrPath: '',
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
userInfo:'',
assetsPath: config.assetsPath,
list:[],
loginStatus: uni.getStorageSync('loginStatus') == 'login'? true: false,
listBlankImage: config.assetsPath + '/no_data_icon.png',
countNum: 0,
countDuration: 0,
queryParams:{
pageSize:5,
pageNum:1
}
};
},
components: {
LoginPop,
tkiQrcode
},
onLoad() {
if(this.loginStatus){
this.onGetUserInfo();
}else{
this.$refs.loginPop.open();
}
},
onShareAppMessage() {
return {
title: "邀请扫码注册",
path: `/pages/my/myInfo?uid=${this.userInfo.id}`
}
},
methods:{
onScrolltolower(){
if(this.status == 'loadmore'){
this.queryParams.pageNum+=1;
this.onLoading()
}
},
onLoading(){
equityDurationList(this.queryParams).then(res => {
console.log(res,99999)
// let list = res.data.rows.map(item => {
// this.userInfo.phone.slice(-4)
// return {
// ...item,
// }
// })
if(this.queryParams.pageNum ===1){
this.list = res.data.rows
}else{
this.list.push(...res.data.rows)
}
if(this.list.length >= res.data.total){
this.status = 'nomore'
}else{
this.status = "loadmore"
}
})
},
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
this.loginStatus = uni.getStorageSync('loginStatus') == 'login'? true: false;
this.userInfo = {
...res.data.data,
consumerWallet: res.data.data.consumerWallet? res.data.data.consumerWallet: {remainingIntegral:0}
}
uni.setStorageSync('userInfo', this.userInfo)
this.onEquityBindUser();
this.onLoading();
this.$forceUpdate();
}
})
},
onEquityBindUser() {
equityDuration().then(res => {
this.countDuration = res.data.data
})
equityBindUser().then(res => {
this.countNum = res.data.total
})
},
onShareByQrcode(){
this.text = `https://www.coujio.com/myShare?uid=${this.userInfo.id}&act=0`;
this.loadMake = true;
this.$refs.popupShare.open()
},
onClose() {
this.$refs.popupShare.close()
},
onSaveImg() {
uni.saveImageToPhotosAlbum({
filePath: this.qrPath,
success: () => {
uni.showToast({
icon: 'none',
title: '保存成功'
})
},
fail: (err) => {
console.log(err, 999)
}
})
},
qrR(r) {
this.qrPath = r;
}
}
}
</script>
<style>
page {
background: #ffffff;
}
</style>
<style lang="scss">
.header-content {
align-items: center;
padding:16upx 24upx;
.logo {
width: 116upx;
.logo-bg {
width: 100%;
max-height: 78upx;
}
}
.btn-box {
.cu-btn {
width: 124upx;
height: 42upx;
background: #959192;
border-radius: 6upx;
font-size: 20upx;
color: #FFFFFF;
padding: 0;
}
}
}
.banner{
width: 100%;
margin-top: 24upx;
.banner-bg{
width: 100%;
max-height: 530upx;
}
}
.option-btn{
display: flex;
flex-direction: row;
justify-content: center;
margin: 25upx 0;
.cu-btn{
width: 260upx;
height: 54upx;
border-radius: 27upx;
margin: 0 25upx;
padding: 0;
font-size: 24upx;
color: #FFFFFF;
image{
width: 30upx;
max-height: 26upx;
margin-right: 12upx;
}
}
.part-left{
background: #04CD67;
}
.part-right{
background: #142C57;
}
}
.process{
width: 710upx;
height: 280upx;
background: #FFFFFF;
box-shadow: 1upx 1upx 9upx 1upx rgba(51,51,51,0.18);
border-radius: 4upx;
margin: 24upx auto;
.divider{
width: 320upx;
margin: 0 auto;
}
.margin-top-sm{
padding: 0 24upx;
}
.item{
justify-content: center;
align-items: center;
.flex-row-center{
justify-content: center;
height: 60upx;
.icon{
width: 44upx;
max-height: 40upx;
}
.icon2{
width: 12upx;
max-height: 20upx;
}
}
.flex-col{
align-items: center;
height: 60upx;
font-size: 20upx;
color: #727272;
}
}
.item2{
height: 150upx;
justify-content: center;
align-items: center;
.text-title{
font-size: 28upx;
color: #000000;
margin-bottom: 8upx;
font-weight: bold;
}
.text-1{
font-size: 45upx;
color: #FFAC3E;
font-style: italic;
}
.text-2{
font-size: 24upx;
color: #FFAC3E;
margin: 4upx 0 0 4upx;
}
}
}
.process2{
width: 710upx;
min-height: 280upx;
background: #FFFFFF;
box-shadow: 1upx 1upx 9upx 1upx rgba(51,51,51,0.18);
border-radius: 4upx;
margin: 24upx auto 30upx;
.divider{
width: 320upx;
margin: 0 auto;
}
.list-box{
padding: 0 0 24upx;
}
}
.popup-box-content{
background-color: #ffffff;
width: 72vw;
border-radius: 36upx;
overflow: hidden;
.popup-box-2{
position: relative;
width: 100%;
background: linear-gradient(0deg, rgba(255,255,255,0.65), rgba(255,214,241,0.43));
.close-box{
position: absolute;
top: 16upx;
right: 20upx;
display: flex;
justify-content: center;
align-items: center;
width: 24px;
height: 24px;
font-size: 36upx;
}
.title-header{
display: flex;
justify-content: center;
align-items: center;
padding: 30upx 24upx 8upx;
border-bottom: none;
.text-title{
font-size: 36upx;
color: #333333;
}
}
.popup-content{
padding: 0 24upx;
min-height: 240upx;
.recharge-content{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
.text-1{
font-weight: 400;
font-size: 24upx;
color: #666666;
}
}
}
}
}
.popup-box-share{
width: 90vw;
border-radius: 12upx;
overflow: hidden;
.popup-box-2{
background: #f1f1f1;
}
}
.share-qrcode {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
.qrcode-box {
background-color: #ffffff;
border-radius: 12upx;
box-shadow: 0 0 12upx #ff00ff;
padding: 20upx;
margin-top: 24upx;
}
.part-bottom {
display: flex;
flex-direction: row;
justify-content: center;
margin: 36upx 0;
width: 100%;
.btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex: 1;
height: 88upx;
border-radius: 20upx;
margin: 0 20upx;
image {
display: block;
width: 32upx;
height: auto;
margin-right: 6upx;
}
text {
font-size: 24upx;
}
}
}
}
.scroll-view{
position: relative;
width: 100%;
height: 420upx;
.list-box{
position: absolute;
left: 0;
width: 100%;
.item{
align-items: center;
padding: 12upx 20upx;
.flex-col{
.flex-row-center{
margin-top: 12upx;
}
}
}
}
}
</style>
\ No newline at end of file
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