Commit 3fc004fa by zhangzhen

功能开发完善

parent 057e3fa2
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
wx.login({ wx.login({
success: (res) => { success: (res) => {
login(res.code).then(res => { login(res.code).then(res => {
console.log(res,99999)
if (res.data.code == 200) { if (res.data.code == 200) {
uni.setStorageSync('loginStatus', res.data.data.type) uni.setStorageSync('loginStatus', res.data.data.type)
if (res.data.data.type === "login") { if (res.data.data.type === "login") {
......
...@@ -6,6 +6,18 @@ export const recordsList=(data)=>{ ...@@ -6,6 +6,18 @@ export const recordsList=(data)=>{
return http.get(url,data) return http.get(url,data)
} }
// 积分日志
export const integralList=(data)=>{
let url=`/integralLog/query`
return http.get(url,data)
}
// 时长日志
export const durationList=(data)=>{
let url=`/durationLog/query`
return http.get(url,data)
}
// 充值配置 // 充值配置
export const rechargeConf=(data)=>{ export const rechargeConf=(data)=>{
let url=`/rechargeConf/list` let url=`/rechargeConf/list`
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
success: (res) => { success: (res) => {
login(res.code).then(res => { login(res.code).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.setStorageSync('loginStatus', res.data.data.type)
if (res.data.data.type === "login") { if (res.data.data.type === "login") {
uni.setStorageSync('tokenHeaders', "Authori-zation") uni.setStorageSync('tokenHeaders', "Authori-zation")
uni.setStorage({ uni.setStorage({
......
...@@ -194,7 +194,21 @@ ...@@ -194,7 +194,21 @@
{ {
"path": "recharge/record", "path": "recharge/record",
"style": { "style": {
"navigationBarTitleText": "余额使用记录", "navigationBarTitleText": "余额记录",
"enablePullDownRefresh" : false
}
},
{
"path": "recharge/integral",
"style": {
"navigationBarTitleText": "积分记录",
"enablePullDownRefresh" : false
}
},
{
"path": "recharge/duration",
"style": {
"navigationBarTitleText": "时长记录",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
}, },
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
<text class="text-2">权益会员</text> <text class="text-2">权益会员</text>
</view> </view>
</view> </view>
<view v-if="!userInfo.consumerMember || !(userInfo.consumerMember.isRights && userInfo.consumerMember.isRecharge) " class="relative" @tap.stop="onNavToVip"> <view v-if="!userInfo.consumerMember || !(userInfo.consumerMember && userInfo.consumerMember.isRights && userInfo.consumerMember.isRecharge) " class="relative" @tap.stop="onNavToVip">
<image class="img-icon" :src="assetsPath+'/tag_icon_3.png'" mode="widthFix"></image> <image class="img-icon" :src="assetsPath+'/tag_icon_3.png'" mode="widthFix"></image>
<view class="absolute"> <view class="absolute">
<text class="text-3">普通会员</text> <text class="text-3">普通会员</text>
</view> </view>
</view> </view>
</view> </view>
<view v-if="userInfo.consumerMember.isRights" class="tip-date"> <view v-if="userInfo.consumerMember && userInfo.consumerMember.isRights" class="tip-date">
<text>权益 <text class="text-bold">{{userInfo.consumerMember.expirationDate}}</text> 到期</text> <text>权益 <text class="text-bold">{{userInfo.consumerMember.expirationDate}}</text> 到期</text>
<text class="text-blue" @tap.stop="onOpenEquityMembers">{{list && list.length?list[0].requiredAmount+'元':''}}续费</text> <text class="text-blue" @tap.stop="onOpenEquityMembers">{{list && list.length?list[0].requiredAmount+'元':''}}续费</text>
</view> </view>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<view class=""></view> <view class=""></view>
</view> </view>
<view class="flex-row-center"> <view class="flex-row-center">
<view class="item-box"> <view class="item-box" @tap="onNavToRecords(1)">
<view class="icon-img"> <view class="icon-img">
<image :src="assetsPath+'/user/wallet_icon_1.png'" mode="scaleToFill"></image> <image :src="assetsPath+'/user/wallet_icon_1.png'" mode="scaleToFill"></image>
</view> </view>
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.balance || 0}}</text> <text class="text-black text-lg text-bold">{{userInfo.consumerWallet.balance || 0}}</text>
</view> </view>
</view> </view>
<view class="item-box"> <view class="item-box" @tap="onNavToRecords(2)">
<view class="icon-img"> <view class="icon-img">
<image :src="assetsPath+'/user/wallet_icon_2.png'" mode="scaleToFill"></image> <image :src="assetsPath+'/user/wallet_icon_2.png'" mode="scaleToFill"></image>
</view> </view>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.remainingIntegral || 0}}</text> <text class="text-black text-lg text-bold">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view> </view>
</view> </view>
<view class="item-box"> <view class="item-box" @tap="onNavToRecords(3)">
<view class="icon-img"> <view class="icon-img">
<image :src="assetsPath+'/user/wallet_icon_3.png'" mode="scaleToFill"></image> <image :src="assetsPath+'/user/wallet_icon_3.png'" mode="scaleToFill"></image>
</view> </view>
...@@ -375,10 +375,12 @@ ...@@ -375,10 +375,12 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<LoginPop ref="loginPop" />
</view> </view>
</template> </template>
<script> <script>
import LoginPop from "@/components/login/login"
import fTabbar from '@/components/module/f-tabbar/f-tabbar'; import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import { import {
getUserInfo, getUserInfo,
...@@ -400,6 +402,7 @@ ...@@ -400,6 +402,7 @@
export default { export default {
components: { components: {
LoginPop,
fTabbar fTabbar
}, },
data() { data() {
...@@ -457,7 +460,8 @@ ...@@ -457,7 +460,8 @@
levelDetail:"/setting/levelDetail/index" levelDetail:"/setting/levelDetail/index"
}, },
list:'', list:'',
consumerMemberStatus:false consumerMemberStatus:false,
loginStatus: uni.getStorageSync('loginStatus') == 'login'? true: false
} }
}, },
onShow() { onShow() {
...@@ -572,9 +576,6 @@ ...@@ -572,9 +576,6 @@
} }
}, },
onClose() {
this.$refs.popup.close()
},
onCopy() { onCopy() {
uni.setClipboardData({ uni.setClipboardData({
data: this.wifiData.password data: this.wifiData.password
...@@ -621,9 +622,15 @@ ...@@ -621,9 +622,15 @@
}) })
}, },
onNavByPath(pathName){ onNavByPath(pathName){
if(["levelDetail"].includes(pathName) && !this.loginStatus){
console.log(pathName,999999)
this.$refs.loginPop.open();
}else{
uni.navigateTo({ uni.navigateTo({
url:this.routePathEnum[pathName] url:this.routePathEnum[pathName]
}) })
}
}, },
onNavToVip(){ onNavToVip(){
uni.switchTab({ uni.switchTab({
...@@ -699,7 +706,37 @@ ...@@ -699,7 +706,37 @@
}) })
}, },
onClose() { onClose() {
this.$refs.popup.close()
this.$refs.popupPay.close() this.$refs.popupPay.close()
},
onNavToRecords(t){
if(this.loginStatus){
if(t==1){
if(this.userInfo.consumerMember && this.userInfo.consumerMember.isRecharge){
uni.navigateTo({
url:"/setting/recharge/record"
})
}else{
uni.showToast({
icon:"none",
title:"您还未充值哟!"
})
}
}else if(t==2){
uni.navigateTo({
url:"/setting/recharge/integral"
})
}else if(t==3){
uni.navigateTo({
url:"/setting/recharge/duration"
})
}
} else {
this.$refs.loginPop.open();
}
} }
} }
} }
......
...@@ -92,7 +92,10 @@ ...@@ -92,7 +92,10 @@
<text>{{item.labelName}}</text> <text>{{item.labelName}}</text>
</view> </view>
<view v-if="item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))" class="pre-icon"> <view v-if="item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))" class="pre-icon">
<image :src="activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'" mode="widthFix"></image> <image :src="
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId) && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(!item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)) ? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'" mode="widthFix"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -103,7 +106,7 @@ ...@@ -103,7 +106,7 @@
<text>{{item.name}}</text> <text>{{item.name}}</text>
</view> </view>
<view class="pre-icon"> <view class="pre-icon">
<image :src="assetsPath+'/pre_icon.png'" mode="widthFix"></image> <image :src=" activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.id)? assetsPath+'/pre_icon_2.png' : assetsPath+'/pre_icon.png'" mode="widthFix"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -1093,7 +1096,6 @@ ...@@ -1093,7 +1096,6 @@
} }
} }
console.log(this.activityDate,"this.activityDate")
} }
}) })
}, },
......
...@@ -666,10 +666,11 @@ ...@@ -666,10 +666,11 @@
.bg-header { .bg-header {
display: block; display: block;
width: 100%;
image { image {
display: block; display: block;
width: 100%; width: 100%;
min-height: 600upx;
} }
} }
......
<template>
<view class="order-record">
<view v-if="loginStatus" class="content-box">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1">
<view class="">
<text class="text-title">{{item.operationType? '增加' : "消费"}}</text>
</view>
<view class="flex-row">
<text class="text-bold text-xl" :class="item.sign=='income'?'text-red':'text-black'">{{item.operationType?'+':'-'}}</text>
<text class="text-black text-bold text-lg" >{{item.variableDuration}}小时</text>
</view>
</view>
<view class="flex-between part-1">
<text>{{item.operationTime}}</text>
<text>剩余{{item.operationType? item.currentDuration+item.variableDuration : item.currentDuration-item.variableDuration}}小时</text>
</view>
</view>
</view>
</view>
<view v-if="loginStatus && list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<view v-if="loginStatus && 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>
<NoLogin v-model="loginStatus" />
</view>
</template>
<script>
import config from "@/config/index.config"
import {
durationList
} from "@/api/recharge.js"
import NoLogin from "@/components/noLogin/noLogin"
import {
getDictItem
} from "@/utils/tools.js"
export default {
components:{
NoLogin
},
data() {
return {
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
statusIndex: 0,
list: [],
statusList: [{
label: "全部",
value: "",
},
{
label: "已预约",
value: "0",
},
{
label: "使用中",
value: "1",
},
{
label: "已完成",
value: "2",
},
{
label: "退单",
value: "3",
}
],
queryParams: {
pageNum: 1,
pageSize: 10
},
loginStatus:true,
orderStatusEnum:{},
payTypeEnum:{
1:"微信支付",
2:"支付宝支付",
3:"余额支付"
},
payStatus:{
'0':'-',
'1':'+'
},
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
onShow() {
this.onGetDicts()
},
methods: {
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
})
}
},
onLoading() {
uni.showLoading({
title: '加载中'
})
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
durationList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
if (res.data.code == 200) {
this.list = res.data.data
this.status = 'nomore'
}else if(res.data.code == 401){
this.loginStatus = false
}
})
},
tabSelect(i) {
console.log(i, 99999)
this.statusIndex = i;
this.queryParams.pageNum = 1;
this.list = []
this.onLoading()
},
onNavToOrderInfo(val){
uni.navigateTo({
url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
})
}
}
}
</script>
<style>
page{
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.order-record {
display: flex;
flex-direction: column;
.content-box {
display: flex;
flex-direction: column;
.list-content{
display: flex;
flex-direction: column;
align-items: center;
.list-item{
width: 94%;
padding: 20upx 20upx;
border-radius: 20upx;
background-color: #ffffff;
margin-top: 30upx;
.part-1{
display: flex;
align-items: center;
padding: 10upx;
.flex-row{
display: flex;
flex-direction: row;
align-items: center;
}
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="order-record">
<view v-if="loginStatus" class="content-box">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1">
<view class="">
<text class="text-title">{{item.operationType? '增加' : "消费"}}</text>
</view>
<view class="flex-row">
<text class="text-bold text-xl" :class="item.sign=='income'?'text-red':'text-black'">{{item.operationType?'+':'-'}}</text>
<text class="text-black text-bold text-lg" >{{item.variableIntegral}}积分</text>
</view>
</view>
<view class="flex-between part-1">
<text>{{item.operationTime}}</text>
<text>剩余{{item.operationType? item.currentIntegral + item.variableIntegral : item.currentIntegral - item.variableIntegral}}积分</text>
</view>
</view>
</view>
</view>
<view v-if="loginStatus && list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<view v-if="loginStatus && 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>
<NoLogin v-model="loginStatus" />
</view>
</template>
<script>
import config from "@/config/index.config"
import {
integralList
} from "@/api/recharge.js"
import NoLogin from "@/components/noLogin/noLogin"
import {
getDictItem
} from "@/utils/tools.js"
export default {
components:{
NoLogin
},
data() {
return {
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
statusIndex: 0,
list: [],
statusList: [{
label: "全部",
value: "",
},
{
label: "已预约",
value: "0",
},
{
label: "使用中",
value: "1",
},
{
label: "已完成",
value: "2",
},
{
label: "退单",
value: "3",
}
],
queryParams: {
pageNum: 1,
pageSize: 10
},
loginStatus:true,
orderStatusEnum:{},
payTypeEnum:{
1:"微信支付",
2:"支付宝支付",
3:"余额支付"
},
payStatus:{
'0':'-',
'1':'+'
},
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
onShow() {
this.onGetDicts()
},
methods: {
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
})
}
},
onLoading() {
uni.showLoading({
title: '加载中'
})
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
integralList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
if (res.data.code == 200) {
this.list = res.data.data
this.status = 'nomore'
}else if(res.data.code == 401){
this.loginStatus = false
}
})
},
tabSelect(i) {
console.log(i, 99999)
this.statusIndex = i;
this.queryParams.pageNum = 1;
this.list = []
this.onLoading()
},
onNavToOrderInfo(val){
uni.navigateTo({
url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
})
}
}
}
</script>
<style>
page{
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.order-record {
display: flex;
flex-direction: column;
.content-box {
display: flex;
flex-direction: column;
.list-content{
display: flex;
flex-direction: column;
align-items: center;
.list-item{
width: 94%;
padding: 20upx 20upx;
border-radius: 20upx;
background-color: #ffffff;
margin-top: 30upx;
.part-1{
display: flex;
align-items: center;
padding: 10upx;
.flex-row{
display: flex;
flex-direction: row;
align-items: center;
}
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1"> <view class="flex-between part-1">
<view class=""> <view class="">
<text class="text-title">{{item.operationType? '退款' : "消费"}}</text> <text class="text-title">{{item.operationType? '增加' : "消费"}}</text>
</view> </view>
<view class="flex-row"> <view class="flex-row">
<text class="text-bold text-xl" :class="item.sign=='income'?'text-red':'text-black'">{{item.operationType?'+':'-'}}</text> <text class="text-bold text-xl" :class="item.sign=='income'?'text-red':'text-black'">{{item.operationType?'+':'-'}}</text>
......
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