充值 订单 会员 个人中心

This commit is contained in:
1154079537 2024-06-06 17:50:25 +08:00
parent 91fb79033b
commit 2348230bab
20 changed files with 1056 additions and 594 deletions

10
App.vue
View File

@ -1,13 +1,19 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch');
uni.addInterceptor('navigateTo', {
invoke(e) {
console.log('路由监听');
console.log(e);
}
})
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')
}, },
onHide: function() { onHide: function() {
console.log('App Hide') console.log('App Hide');
} }
} }
</script> </script>

View File

@ -55,3 +55,8 @@ export const writeOrderApi = (data) => {
export const writeCountApi = (data) => { export const writeCountApi = (data) => {
return request.post('/order/order/write_count', data); return request.post('/order/order/write_count', data);
} }
// 根据核销码查询记录
export const writeCodeApi = (data) => {
return request.post('/order/order/write_code', data);
}

View File

@ -61,3 +61,36 @@ export const merchantListApi = (data) => {
export const rechargeApi = (data) => { export const rechargeApi = (data) => {
return request.post('/user/user/recharge', data); return request.post('/user/user/recharge', data);
} }
// 商品访问记录
export const productLogApi = (data) => {
return request.post('/user/UserVisit/productLog', data);
}
// 用户页面访问记录
export const htmlLogApi = (data) => {
return request.post('/user/UserVisit/htmlLog', data);
}
// 用户页面访问记录
export const userInfoApi = (data) => {
return request.post('/user/user/info', data);
}
// 充值规格
export const rechargeAmountApi = (data) => {
return request.post('/user/user/rechange_amount', data);
}
// 会员账户统计
export const capitalCountAPi = (data) => {
return request.post('/user/user/capital_count', data);
}
// 会员账户详情
export const chargeListApi = (data) => {
return request.post('/user/user/capital_flow', data);
}

View File

@ -6,7 +6,7 @@
</view> </view>
<view class="row"> <view class="row">
<view>商品名称</view> <view>商品名称</view>
<view>{{datas.name || datas.goods_name}}</view> <view>{{datas.name || datas.goods_name || datas.store_name}}</view>
</view> </view>
<view class="row"> <view class="row">
<view>商品单位</view> <view>商品单位</view>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

View File

@ -48,7 +48,7 @@
</block> </block>
</view> </view>
<u-loadmore :status="status" iconColor="#666" /> <up-loadmore :status="status" iconColor="#b3b3b3" color="#b3b3b3" />
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
@ -122,7 +122,7 @@
status.value == 'loading'; status.value == 'loading';
shopListApi(queryParams).then(res => { shopListApi(queryParams).then(res => {
let len = res.data.lists; let len = res.data.lists;
status.value = queryParams.page_size > len ? 'nomore' : 'loadmore'; status.value = queryParams.page_size > len.length ? 'nomore' : 'loadmore';
shopList.value = shopList.value.concat(res.data.lists); shopList.value = shopList.value.concat(res.data.lists);
if (status.value == 'loadmore') queryParams.page_no += 1; if (status.value == 'loadmore') queryParams.page_no += 1;
}) })

View File

@ -7,7 +7,7 @@
<view class="verification-title">核销券码</view> <view class="verification-title">核销券码</view>
<u-input v-model="writeCode" inputAlign="center" :customStyle="{'border-color':'#38BE41 !important'}" <u-input v-model="writeCode" inputAlign="center" :customStyle="{'border-color':'#38BE41 !important'}"
placeholder="请输入核销券码"></u-input> placeholder="请输入核销券码"></u-input>
<view class="verification-btn" :style="{opacity:writeCode?1:'.6'}" @click="onConfirmWrite">确认核销</view> <view class="verification-btn" :style="{opacity:writeCode?1:'.6'}" @click="onConfirmProduct">确认核销</view>
</view> </view>
<!-- 二维码 --> <!-- 二维码 -->
@ -21,30 +21,34 @@
</view> </view>
</view> </view>
<!-- 弹框 --> <!-- 弹框 1-1717497530223296 -->
<u-popup :show="show" @close="close" @open="open" mode="center"> <u-popup :show="show" @close="close" @open="open" mode="center" v-if="shopDetail != null">
<view class="popup"> <view class="popup">
<view class="popup-wrap"> <view class="popup-wrap">
<view class="popup-title">请确认核销订单</view> <view class="popup-title">请确认核销订单</view>
<view class="popup-order_num">订单编号:wxo1709797879549583601</view> <view class="popup-order_num">订单编号:{{shopDetail.order_id}}</view>
<view class="popup-goods">
<view class="popup-goods-wrap">
<view class="popup-goods" v-for="item in shopDetail.goods_list" :key="item.id">
<view class="popup-goods-left"> <view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" /> <u-image width="100rpx" height="100rpx" radius="8rpx" :src="item.image" />
</view> </view>
<view class="popup-goods-right"> <view class="popup-goods-right">
<view class="popup-goods-right-info"> <view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text> <text class='goods_name'>{{item.store_name}}</text>
<text class="goods_price">10.00</text> <text class="goods_price">{{item.price}}</text>
</view>
<view class="popup-goods-num">x5</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view> </view>
<view class="popup-goods-num">x{{item.cart_num}}</view>
</view> </view>
</view> </view>
<view class="verification-btn">确认核销</view> <view class="popup-goods-total">
<text class="popup-goods-total-num">{{shopDetail.total_num}}件商品总金额</text>
<text class="popup-goods-total-price">{{shopDetail.total_price}}</text>
</view>
</view>
<view class="verification-btn" @click="onConfirmWrite">确认核销</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@ -56,10 +60,11 @@
ref ref
} from "vue"; } from "vue";
import { import {
writeOrderApi writeOrderApi,
writeCodeApi
} from "@/api/order.js"; } from "@/api/order.js";
const show = ref(false); const show = ref(true);
const writeCode = ref(''); const writeCode = ref('');
// //
@ -68,6 +73,7 @@
writeOrderApi({ writeOrderApi({
verify_code: writeCode.value verify_code: writeCode.value
}).then(res => { }).then(res => {
writeCode.value = ''; //
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ uni.showToast({
title: '核销成功', title: '核销成功',
@ -90,30 +96,22 @@
}) })
} }
// const shopDetail = ref(null);
//
const onConfirmProduct = () => {
writeCodeApi({
code: writeCode.value
}).then(res => {
shopDetail.value = res.data;
})
}
//
const onScanToWrite = () => { const onScanToWrite = () => {
uni.scanCode({ uni.scanCode({
success(resp) { success(resp) {
writeOrderApi({ writeCode.value = resp.result;
verify_code: resp.result onConfirmProduct();
}).then(res => {
if (res.code == 1) {
uni.showToast({
title: '核销成功',
icon: 'none',
success() {
uni.$u.sleep(1500).then(rrr => {
uni.navigateBack();
})
}
})
} else {
uni.showToast({
title: '核销失败',
icon: 'none'
})
}
})
} }
}) })
} }
@ -225,12 +223,12 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 630rpx; width: 630rpx;
height: 190rpx; height: 150rpx;
background: #F7F7F7; background: #F7F7F7;
border-radius: 16rpx; border-radius: 16rpx;
margin-bottom: 36rpx; padding: 24rpx 24rpx 0;
padding: 24rpx;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 20rpx;
.popup-goods-left { .popup-goods-left {
margin-right: 24rpx; margin-right: 24rpx;
@ -263,6 +261,8 @@
color: #777777; color: #777777;
text-align: right; text-align: right;
} }
}
}
.popup-goods-total { .popup-goods-total {
text-align: right; text-align: right;
@ -280,6 +280,4 @@
} }
} }
} }
}
}
</style> </style>

View File

@ -26,9 +26,9 @@
<text class="popup-goods-total-num">共计{{shopInfo.total_num || 0}}</text> <text class="popup-goods-total-num">共计{{shopInfo.total_num || 0}}</text>
</view> </view>
<view class="batch-write" @click="onClickToWrite"> <view class="batch-write" @click="onClickToWrite" v-if="shopInfo.is_writeoff != 1">
<up-image width="36rpx" height="36rpx" src="@/multipleShop/images/scan.png" /> <image class="btn-img" src="../images/scan.png"></image>
<view>扫码核销</view> <view class="btn-txt">扫码核销</view>
</view> </view>
</view> </view>
</template> </template>
@ -158,7 +158,6 @@
.popup-goods-total { .popup-goods-total {
text-align: right; text-align: right;
margin-bottom: 50rpx;
.popup-goods-total-num { .popup-goods-total-num {
font-size: 24rpx; font-size: 24rpx;
@ -175,8 +174,14 @@
height: 90rpx; height: 90rpx;
background: #20B128; background: #20B128;
border-radius: 20rpx; border-radius: 20rpx;
margin-top: 50rpx;
&>view { .btn-img {
width: 76rpx;
height: 76rpx;
}
.btn-txt {
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
margin-left: 8rpx; margin-left: 8rpx;

View File

@ -27,7 +27,8 @@
</view> </view>
<view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)"> <view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)">
<up-image width="76rpx" height="76rpx" src="@/multipleShop/images/scan.png" /> <!-- <up-image width="76rpx" height="76rpx" src="../images/scan.png" /> -->
<image src="../images/scan.png"></image>
</view> </view>
</view> </view>
</view> </view>
@ -37,7 +38,7 @@
<view class="order-list-item-order_num">订单编号:{{item.order_id}}</view> <view class="order-list-item-order_num">订单编号:{{item.order_id}}</view>
<view class="order-list-item-trans"> <view class="order-list-item-trans">
<view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)"> <view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)">
<up-image width="76rpx" height="76rpx" src="@/multipleShop/images/write_done.png" /> <u-image width="76rpx" height="76rpx" src="../images/write_done.webp" />
</view> </view>
<view class="order-list-item-trans-right"> <view class="order-list-item-trans-right">
@ -55,10 +56,9 @@
</view> </view>
</scroll-view> </scroll-view>
<view class="batch-write" @click="onPatchWrite"> <view class="batch-write" @click="onPatchWrite">
<up-image width="36rpx" height="36rpx" src="@/multipleShop/images/scan.png" /> <image class="btn-img" src="../images/scan.png"></image>
<view>扫码核销</view> <view class="btn-txt">扫码核销</view>
</view> </view>
</view> </view>
</view> </view>
@ -135,9 +135,6 @@
}) })
} }
}) })
// uni.navigateTo({
// url: "/multipleShop/verification/detail?id=" + item.id
// })
} }
// //
@ -200,6 +197,9 @@
onSearch(); onSearch();
getList(); getList();
// home
uni.hideHomeButton();
}) })
</script> </script>
@ -270,6 +270,11 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-right: 38rpx; margin-right: 38rpx;
image {
width: 76rpx;
height: 76rpx;
}
} }
.order-list-item-trans-right { .order-list-item-trans-right {
@ -315,7 +320,12 @@
background: #20B128; background: #20B128;
border-radius: 20rpx; border-radius: 20rpx;
&>view { .btn-img {
width: 60rpx;
height: 60rpx;
}
.btn-txt {
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
margin-left: 8rpx; margin-left: 8rpx;
@ -323,8 +333,6 @@
} }
} }
.order-tab { .order-tab {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -9,13 +9,7 @@
} }
}, },
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/member/member",
"style": {
"navigationBarTitleText": "会员充值",
"enablePullDownRefresh": false,
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
@ -55,6 +49,20 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/charge/charge_record",
"style": {
"navigationBarTitleText": "充值记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/charge/charge",
"style": {
"navigationBarTitleText": "会员充值",
"enablePullDownRefresh": false
}
} }
], ],
"subPackages": [{ "subPackages": [{
@ -65,8 +73,8 @@
"navigationBarTitleText": "选择门店", "navigationBarTitleText": "选择门店",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
}, { {
"path": "verificationOrder/index", "path": "verificationOrder/index",
"style": { "style": {
"navigationBarTitleText": "核销订单", "navigationBarTitleText": "核销订单",
@ -85,7 +93,8 @@
"navigationBarTitleText": "订单核销", "navigationBarTitleText": "订单核销",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}] }
]
}, { }, {
"root": "pagesOrder", "root": "pagesOrder",
"pages": [{ "pages": [{

View File

@ -1,12 +1,179 @@
<!-- 会员充值 --> <!-- 会员充值 -->
<template>
<view class="member">
<view class="card" :style="{'background-image':'url(../../static/icon/charge_bg.webp)'}">
<view class="card-info">
<u-image width="100rpx" height="100rpx" :src="userInfo.avatar" />
<view class="card-info-right">
<view class="phone">{{userInfo.mobile}}</view>
<view class="level">初级会员 享受{{userInfo.discount}}折优惠</view>
</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text>当前已充值{{userInfo.total_recharge_amount}}升级还需{{userInfo.next_limit}}</text>
<text>{{userInfo.next_level}}</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
<view class="charge-right">升级会员</view>
</view>
</view>
<!-- 充值规格 -->
<view class="rules">
<view class="rules-title">
<view class="rules-title-main">充值规格</view>
<view class="rules-title-record" @click="onPageToRecord">
充值记录
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="rules-con">
<block v-for="item in chargeRulesList" :key="item.id">
<view class="rules-con-item" :class="{'active':isChooseMoney==item.id?true:false}"
@click="isChooseMoney = item.id">
<view class="rules-con-item-main">{{item.name}}</view>
<view class="rules-con-item-sub">{{item.remark?item.remark:'永久'}}</view>
<view class="rules-con-item-amount">
<text class="symbol"></text>
<text>{{item.value}}</text>
</view>
</view>
</block>
<view class="rules-con-item" :class="{'active':isChooseMoney=='input'?true:false}"
@click="isChooseMoney = 'input'">
<view class="rules-con-item-main">自定义金额</view>
<view class="rules-con-item-sub">永久</view>
<view class="rules-con-item-amount">
<up-input v-model="chargeMoney" placeholder="点击输入金额" border="none" type="number" color="#333"
fontSize="28rpx" inputAlign="center"
placeholderStyle="color:'#989898';'font-size':'24rpx';text-align:center;"></up-input>
</view>
</view>
</view>
</view>
<!-- 注意事项 -->
<view class="attention">
<view class="attention-title"><text>注意事项</text></view>
<view class="attention-tips">1充值后帐户的金额不能提现可用于消费使用</view>
<view class="attention-tips">2账户充值出现问题可联系平台客服也可拨打平台客服咨询热线4008888888</view>
</view>
<view class="member-btn" @click="onConfirmCharge">
<view class="btn-wrap">
确认充值
</view>
</view>
</view>
</template>
<script setup>
import {
rechargeApi,
rechargeAmountApi
} from "@/api/user.js";
import {
onLoad
} from "@dcloudio/uni-app";
import {
ref
} from "vue";
import useUserStore from "@/store/user";
//
const userInfo = useUserStore().userInfo;
const isChooseMoney = ref('');
const chargeMoney = ref('');
//
const chargeRulesList = ref([]);
const getChargeRules = () => {
rechargeAmountApi().then(rs => {
chargeRulesList.value = rs.data;
})
}
//
const onPageToRecord = () => {
uni.navigateTo({
url: '/pages/charge/charge_record',
fail(err) {
console.log(err);
}
})
}
//
const onConfirmCharge = () => {
if (!isChooseMoney.value) return uni.$u.toast('充值金额不能为空');
let money = 0;
if (isChooseMoney.value == 'input') {
money = chargeMoney.value;
} else {
const rule = chargeRulesList.value.find(i => i.id == isChooseMoney.value);
if (rule != undefined) {
money = rule.value;
}
}
rechargeApi({
price: money
}).then(res => {
if (!res.data?.nonceStr) return uni.$u.toast('支付失败!');
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (e) => {
if (e.errMsg == 'requestPayment:ok') {
uni.showModal({
title: '充值成功',
confirmText: '查看记录',
cancelText: '继续充值',
success: (e) => {
chargeMoney.value = '';
isChooseMoney.value = '';
if (e.confirm) {
uni.navigateTo({
url: '/pages/charge/charge_record'
})
}
},
fail(err) {
console.log(err);
}
})
} else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付');
}
})
})
}
onLoad(() => {
getChargeRules();
})
</script>
<style lang="scss"> <style lang="scss">
.member { .member {
// padding-top: 40rpx;
padding: 40rpx 0 300rpx 0; padding: 40rpx 0 300rpx 0;
.card { .card {
background: linear-gradient(to right, #F7EED7, #E7DAAF); background: linear-gradient(to right, #F7EED7, #E7DAAF);
height: 302rpx; background-size: 100%;
background-repeat: no-repeat;
height: 272rpx;
margin: 0 30rpx 30rpx; margin: 0 30rpx 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
padding: 20rpx 0 0 20rpx; padding: 20rpx 0 0 20rpx;
@ -34,17 +201,6 @@
} }
} }
.money {
display: flex;
font-size: 28rpx;
color: #FFFFFF;
margin-bottom: 34rpx;
text {
margin-right: 116rpx;
}
}
.charge { .charge {
display: flex; display: flex;
align-items: center; align-items: center;
@ -149,6 +305,11 @@
} }
} }
} }
.active {
border: 2rpx solid #EFCC6E;
background: #FEF8E7;
}
} }
} }
@ -172,9 +333,10 @@
display: block; display: block;
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; top: 50%;
transform: translateY(-50%);
width: 6rpx; width: 6rpx;
height: 100%; height: 70%;
border-radius: 4rpx; border-radius: 4rpx;
background: #FF8056; background: #FF8056;
} }
@ -189,12 +351,25 @@
.member-btn { .member-btn {
position: fixed; position: fixed;
bottom: 80rpx; bottom: 0rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
height: 110rpx;
background-color: #F6F6F6;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding-bottom: constant(safe-area-inset-bottom);
/* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */
.btn-wrap {
width: 670rpx; width: 670rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
margin: 0 auto;
background: #EFCC6E; background: #EFCC6E;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;
@ -202,75 +377,5 @@
text-align: center; text-align: center;
} }
} }
}
</style> </style>
<template>
<view class="member">
<view class="card">
<view class="card-info">
<up-image width="100rpx" height="100rpx" />
<view class="card-info-right">
<view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view>
</view>
</view>
<view class="money">
<text>余额10000</text>
<view>充值</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text>当前已充值1000升级还需2000</text>
<text>Lv.2</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
<view class="charge-right">升级会员</view>
</view>
</view>
<!-- 充值规格 -->
<view class="rules">
<view class="rules-title">
<view class="rules-title-main">充值规格</view>
<view class="rules-title-record">
充值记录
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="rules-con">
<view class="rules-con-item" v-for="item in 4">
<view class="rules-con-item-main">基础会员</view>
<view class="rules-con-item-sub">永久</view>
<view class="rules-con-item-amount">
<text class="symbol"></text>
<text>1000</text>
</view>
</view>
<view class="rules-con-define">
<up-input placeholder="点击输入金额" type="number" color="#333" fontSize="28rpx"
:placeholderStyle="{color:'#989898'}">
<template #prefix>
<up-text text="自定义金额" color="#111" size="30rpx" margin="0 3px 0 0" type="tips"></up-text>
</template>
</up-input>
</view>
</view>
</view>
<!-- 注意事项 -->
<view class="attention">
<view class="attention-title"><text>注意事项</text></view>
<view class="attention-tips">1充值后帐户的金额不能提现可用于消费使用</view>
<view class="attention-tips">2账户充值出现问题可联系平台客服也可拨打平台客服咨询热线4008888888</view>
</view>
<view class="member-btn">
确认充值
</view>
</view>
</template>

View File

@ -0,0 +1,286 @@
<!-- 会员充值 -->
<template>
<view class="member">
<view class="card-wrap">
<view class="card" :style="{'background-image':'url(../../static/icon/account_bg.webp)'}">
<view class="card-info">
<u-image width="100rpx" height="100rpx" :src="userInfo.avatar" />
<view class="card-info-right">
<view class="phone">{{userInfo.mobile}}</view>
<view class="level">开通会员 享折扣权益</view>
</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text class="txt">账户余额()</text>
<text class="money">{{userInfo.now_money}}</text>
</view>
</view>
<view class="charge-right" @click="onPageBack">充值</view>
</view>
</view>
</view>
<view class="detail">
<view class="detail-title">账户详情</view>
<view class="detail-total">
<view class="detail-total-item">
<text>累计消费</text>
<view>{{order}}</view>
</view>
<view class="detail-total-item">
<text>累计充值</text>
<view>{{recharge}}</view>
</view>
</view>
<view class="detail-card" v-if="chargeRecordList.length > 0">
<block v-for="(item,indx) in chargeRecordList" :key="indx">
<view class="detail-card-item">
<view class="detail-card-item-left">
<u-image width="60rpx" height="60rpx" src="../../static/icon/order.webp"
v-if="item.category=='user_order_pay'" />
<u-image width="60rpx" height="60rpx" src="../../static/icon/diamond.webp" v-else />
</view>
<view class="detail-card-item-right">
<view class="detail-card-item-right-money">
<text>{{item.category=='user_order_pay'?'订单编号':'会员充值'}} </text>
<text>+{{item.amount}}</text>
</view>
<viewl class="detail-card-item-right-remind">
<text>{{item.create_time}}</text>
<text>余额{{item.before_balance}}</text>
</viewl>
</view>
</view>
</block>
</view>
<up-loadmore :status="status" iconColor="#b3b3b3" color="#b3b3b3" />
</view>
</view>
</template>
<script setup>
import {
rechargeApi,
capitalCountAPi,
chargeListApi
} from "@/api/user.js";
import {
onLoad,
onReachBottom
} from "@dcloudio/uni-app";
import {
reactive,
ref
} from "vue";
import useUserStore from "@/store/user";
//
const userInfo = useUserStore().userInfo;
const queryParams = reactive({
page_no: 1,
page_size: 8
});
const status = ref('');
const chargeRecordList = ref([]);
const getChargeRecordData = () => {
if (status.value == 'nomore') return;
if (status.value == 'loading') return;
status.value == 'loading';
chargeListApi(queryParams).then(res => {
let len = res.data.data;
status.value = queryParams.page_size > len.length ? 'nomore' : 'loadmore';
chargeRecordList.value = chargeRecordList.value.concat(res.data.data);
if (status.value == 'loadmore') queryParams.page_no += 1;
})
}
//
const order = ref(0),
recharge = ref(0);
const getChargeCountData = () => {
capitalCountAPi().then(rs => {
order.value = rs.data.order;
recharge.value = rs.data.recharge;
})
}
const onPageBack = () => {
uni.navigateBack()
}
onLoad(() => {
getChargeRecordData();
getChargeCountData();
})
onReachBottom((e) => {
getChargeRecordData();
})
</script>
<style lang="scss">
.member {
padding-bottom: 300rpx;
.card-wrap {
padding: 40rpx 0 20rpx 0;
background-color: #fff;
margin-bottom: 30rpx;
.card {
background-size: 100%;
background-repeat: no-repeat;
height: 272rpx;
margin: 0 30rpx;
border-radius: 10rpx;
padding: 20rpx 0 0 20rpx;
box-sizing: border-box;
background-color: #fff;
.card-info {
display: flex;
align-items: center;
margin-bottom: 60rpx;
.card-info-right {
margin-left: 40rpx;
.phone {
margin-bottom: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.level {
font-size: 28rpx;
color: #7B5232;
}
}
}
.charge {
display: flex;
align-items: center;
padding-right: 38rpx;
.charge-left {
flex: 1;
display: flex;
margin-right: 30rpx;
&>view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
.txt {
margin-right: 16rpx;
font-size: 24rpx;
color: #7B5232;
}
.money {
font-weight: 600;
font-size: 48rpx;
color: #7B5232;
}
}
}
.charge-right {
width: 148rpx;
height: 52rpx;
line-height: 52rpx;
background: #7B5232;
border-radius: 30rpx;
font-size: 22rpx;
color: #FFFFFF;
text-align: center;
}
}
}
}
.detail {
margin: 0 30rpx;
.detail-title {
margin-bottom: 16rpx;
font-weight: 600;
font-size: 32rpx;
color: #262626;
}
.detail-total {
display: flex;
align-items: center;
margin-bottom: 50rpx;
.detail-total-item {
display: flex;
align-items: center;
margin-right: 68rpx;
text {
margin-right: 4rpx;
font-size: 28rpx;
color: #777777;
}
view {
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
}
}
}
.detail-card {
background-color: #fff;
border-radius: 12rpx;
padding: 0 20rpx;
box-sizing: border-box;
.detail-card-item {
display: flex;
align-items: center;
height: 130rpx;
border-bottom: 2rpx solid #F3F3F3;
.detail-card-item-left {
margin-right: 22rpx;
}
.detail-card-item-right {
flex: 1;
.detail-card-item-right-money {
margin-bottom: 14rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
color: #333333;
}
.detail-card-item-right-remind {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #333333;
}
}
}
}
}
</style>

View File

@ -170,7 +170,11 @@
cartCreateApi, cartCreateApi,
cartChangeApi, cartChangeApi,
cartListApi cartListApi
} from "@/api/cart.js" } from "@/api/cart.js";
import {
productLogApi,
userInfoApi
} from "@/api/user.js";
import viewPopup from "@/components/viewPopup.vue" import viewPopup from "@/components/viewPopup.vue"
import goodPopup from "@/components/goodPopup.vue" import goodPopup from "@/components/goodPopup.vue"
import useCartStore from "@/store/cart.js" import useCartStore from "@/store/cart.js"
@ -187,7 +191,6 @@
}) })
} }
/*商品列表滚动隐藏头部导航 */ /*商品列表滚动隐藏头部导航 */
const instance = getCurrentInstance(); // const instance = getCurrentInstance(); //
const targetHeight = ref(0) const targetHeight = ref(0)
@ -241,7 +244,6 @@
}).then(res => { }).then(res => {
getCartList(); getCartList();
}).catch(err => { }).catch(err => {
console.log(err);
uni.$u.toast('添加失败') uni.$u.toast('添加失败')
}) })
} }
@ -301,7 +303,7 @@
const classMap = new Map(); const classMap = new Map();
const getgoodClassList = (pid = 0, three = 0) => { const getgoodClassList = (pid = 0, three = 0) => {
let page_no = classMap.get(pid) || 1; let page_no = classMap.get(pid) || 1;
console.log(classMap.get(pid)); // console.log(classMap.get(pid));
goodClassListApi({ goodClassListApi({
pid: pid, pid: pid,
page_no: page_no, page_no: page_no,
@ -381,8 +383,7 @@
} }
const navTo = (url) => { const navTo = (url) => {
// if (!userStore.token || !userStore.userInfo.mobile) return uni.showModal({ if (!userStore.token || !userStore.userInfo.mobile) return uni.showModal({
if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录', content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => { success: (e) => {
if (e.confirm) { if (e.confirm) {
@ -410,6 +411,13 @@
goodData.value = item; goodData.value = item;
goodRef.value.setData(item); goodRef.value.setData(item);
showGoodPopup.value = true; showGoodPopup.value = true;
//访
productLogApi({
product_id: item.product_id,
cate_id: item.cate_id
});
}; };
const changeGood = (data) => { // const changeGood = (data) => { //
showGoodPopup.value = false; showGoodPopup.value = false;
@ -429,8 +437,6 @@
} }
}); });
console.log(data);
addCart(data.id, data.cart_num); addCart(data.id, data.cart_num);
} }
// //
@ -465,8 +471,21 @@
}) })
onShow(() => { onShow(() => {
getCartList(); //
if (userStore.token && userStore.userInfo.mobile) {
userInfoApi().then(res => {
const user = res.data;
userStore.setUserInfo(user);
if (user.is_staff == 1) {
uni.reLaunch({
url: "/multipleShop/verificationOrder/index"
}) })
} else {
getCartList();
}
});
}
});
onMounted(() => { onMounted(() => {
const instance = getCurrentInstance(); // const instance = getCurrentInstance(); //
@ -486,7 +505,6 @@
setTimeout(() => { setTimeout(() => {
getWXDom() getWXDom()
}, 500) }, 500)
}) })
</script> </script>

View File

@ -149,12 +149,25 @@
userStore.setToken(res.data.token); userStore.setToken(res.data.token);
if (!res.data.mobile) { // if (!res.data.mobile) { //
tempUser.value = res.data; // tempUser.value = res.data;
return showBind.value = true; return showBind.value = true;
} else { } else {
userStore.setUserInfo(res.data); userStore.setUserInfo(res.data);
//
//
if (res.data.is_staff == 1) {
userStore.setUserInfo(res.data);
uni.reLaunch({
url: "/multipleShop/verificationOrder/index"
})
} else { //
uni.reLaunch({
url: "/multipleShop/index/index"
})
} }
navToIndex(); }
// navToIndex();
}) })
}, },
fail: (err) => { fail: (err) => {
@ -173,7 +186,6 @@
}).then(res => { }).then(res => {
// token // token
userStore.setUserInfo(res.data); userStore.setUserInfo(res.data);
// //
if (res.is_staff == 1) { if (res.is_staff == 1) {
userStore.setUserInfo(res.data); userStore.setUserInfo(res.data);

View File

@ -1,75 +1,185 @@
<!-- 会员充值 --> <!-- 会员充值 -->
<!-- <style lang="scss">
.member {
padding: 40rpx 0 300rpx 0;
.card {
background: linear-gradient(to right, #F7EED7, #E7DAAF);
height: 302rpx;
margin: 0 30rpx 30rpx;
border-radius: 10rpx;
padding: 20rpx 0 0 20rpx;
box-sizing: border-box;
.card-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.card-info-right {
margin-left: 40rpx;
.phone {
margin-bottom: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.level {
font-size: 28rpx;
color: #7B5232;
}
}
}
}
}
</style>
<template> <template>
<view class="member"> <view class="member">
<view class="card"> <view class="card-wrap">
<view class="card" :style="{'background-image':'url(../../static/icon/account_bg.webp)'}">
<view class="card-info"> <view class="card-info">
<up-image width="100rpx" height="100rpx" /> <up-image width="100rpx" height="100rpx" />
<view class="card-info-right"> <view class="card-info-right">
<view class="phone">155****4444</view> <view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view> <view class="level">开通会员 享折扣权益</view>
</view> </view>
</view> </view>
<view></view> <view class="charge">
<view class="charge-left">
<view>
<text class="txt">账户余额()</text>
<text class="money">1680.00</text>
</view> </view>
</view> </view>
</template> --> <view class="charge-right">充值</view>
</view>
</view>
</view>
<view class="detail">
<view class="detail-title">账户详情</view>
<view class="detail-total">
<view class="detail-total-item">
<text>累计消费</text>
<view>1000</view>
</view>
<view class="detail-total-item">
<text>累计充值</text>
<view>1000</view>
</view>
</view>
<view class="detail-card">
<view class="detail-card-item">
<view class="detail-card-item-left">
<u-image width="60rpx" height="60rpx"></u-image>
</view>
<view class="detail-card-item-right">
<view class="detail-card-item-right-money">
<text>会员充值</text>
<text>+1000.00</text>
</view>
<viewl class="detail-card-item-right-remind">
<text>2024-06-04 14:00:00</text>
<text>余额1000元</text>
</viewl>
</view>
</view>
<view class="detail-card-item">
<view class="detail-card-item-left">
<u-image width="60rpx" height="60rpx"></u-image>
</view>
<view class="detail-card-item-right">
<view class="detail-card-item-right-money">
<text>会员充值</text>
<text>+1000.00</text>
</view>
<viewl class="detail-card-item-right-remind">
<text>2024-06-04 14:00:00</text>
<text>余额1000元</text>
</viewl>
</view>
</view>
<view class="detail-card-item">
<view class="detail-card-item-left">
<u-image width="60rpx" height="60rpx"></u-image>
</view>
<view class="detail-card-item-right">
<view class="detail-card-item-right-money">
<text>会员充值</text>
<text>+1000.00</text>
</view>
<viewl class="detail-card-item-right-remind">
<text>2024-06-04 14:00:00</text>
<text>余额1000元</text>
</viewl>
</view>
</view>
<view class="detail-card-item" v-for="item in 5">
<view class="detail-card-item-left">
<u-image width="60rpx" height="60rpx"></u-image>
</view>
<view class="detail-card-item-right">
<view class="detail-card-item-right-money">
<text>会员充值</text>
<text>+1000.00</text>
</view>
<viewl class="detail-card-item-right-remind">
<text>2024-06-04 14:00:00</text>
<text>余额1000元</text>
</viewl>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
rechargeApi
} from "@/api/user.js";
import {
onLoad,
onReachBottom
} from "@dcloudio/uni-app"
onLoad(() => {})
onReachBottom((e) => {
console.log(e);
})
rechargeApi({
price: 0.01
}).then(res => {
<!-- 会员充值 --> if (!res.data?.nonceStr) return uni.$u.toast('支付失败!');
console.log(2);
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (e) => {
if (e.errMsg == 'requestPayment:ok') {
uni.showModal({
title: '订单支付成功',
confirmText: '查看订单',
cancelText: '继续购买',
success: (e) => {
if (e.confirm) uni.redirectTo({
url: '/pagesOrder/order/order?back=-1&type=2'
})
else uni.navigateBack();
}
})
} else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付');
uni.redirectTo({
url: '/pagesOrder/order/order?back=-1&type=1'
})
}
})
})
</script>
<style lang="scss"> <style lang="scss">
.member { .member {
// padding-top: 40rpx; padding-bottom: 300rpx;
padding: 40rpx 0 300rpx 0;
.card-wrap {
padding: 40rpx 0 20rpx 0;
background-color: #fff;
margin-bottom: 30rpx;
.card { .card {
background: linear-gradient(to right, #F7EED7, #E7DAAF); background-size: 100%;
height: 302rpx; background-repeat: no-repeat;
margin: 0 30rpx 30rpx; height: 272rpx;
margin: 0 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
padding: 20rpx 0 0 20rpx; padding: 20rpx 0 0 20rpx;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff;
.card-info { .card-info {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 30rpx; margin-bottom: 60rpx;
.card-info-right { .card-info-right {
margin-left: 40rpx; margin-left: 40rpx;
@ -88,17 +198,6 @@
} }
} }
.money {
display: flex;
font-size: 28rpx;
color: #FFFFFF;
margin-bottom: 34rpx;
text {
margin-right: 116rpx;
}
}
.charge { .charge {
display: flex; display: flex;
align-items: center; align-items: center;
@ -106,6 +205,7 @@
.charge-left { .charge-left {
flex: 1; flex: 1;
display: flex;
margin-right: 30rpx; margin-right: 30rpx;
&>view { &>view {
@ -114,9 +214,16 @@
justify-content: space-between; justify-content: space-between;
margin-bottom: 10rpx; margin-bottom: 10rpx;
text { .txt {
font-size: 22rpx; margin-right: 16rpx;
color: #A26341; font-size: 24rpx;
color: #7B5232;
}
.money {
font-weight: 600;
font-size: 48rpx;
color: #7B5232;
} }
} }
} }
@ -133,227 +240,80 @@
} }
} }
} }
}
.rules { .detail {
background: #FFFFFF; margin: 0 30rpx;
border-radius: 16rpx;
margin: 0 30rpx 30rpx;
padding: 30rpx;
.rules-title { .detail-title {
display: flex; margin-bottom: 16rpx;
justify-content: space-between;
align-items: center;
margin-bottom: 34rpx;
.rules-title-main {
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
color: #444444; color: #262626;
} }
.rules-title-record { .detail-total {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 30rpx;
.detail-total-item {
display: flex;
align-items: center;
margin-right: 68rpx;
text {
margin-right: 4rpx;
font-size: 28rpx; font-size: 28rpx;
color: #444444; color: #777777;
}
view {
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
}
} }
} }
.rules-con { .detail-card {
display: flex; background-color: #fff;
flex-wrap: wrap; border-radius: 12rpx;
padding: 0 20rpx;
box-sizing: border-box;
.rules-con-item { .detail-card-item {
display: flex; display: flex;
flex-direction: column;
justify-content: center;
align-items: center; align-items: center;
width: 188rpx; height: 130rpx;
height: 220rpx; border-bottom: 2rpx solid #F3F3F3;
border: 2rpx solid #F1F1F1;
border-radius: 16rpx;
margin-bottom: 28rpx;
&:not(:nth-child(3n)) { .detail-card-item-left {
margin-right: 26rpx; margin-right: 22rpx;
} }
.rules-con-item-main { .detail-card-item-right {
margin-bottom: 10rpx; flex: 1;
.detail-card-item-right-money {
margin-bottom: 14rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
} }
.rules-con-item-sub { .detail-card-item-right-remind {
margin-bottom: 30rpx; display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
color: #777777;
}
.rules-con-item-amount {
text {
font-weight: 600;
font-size: 32rpx;
color: #333333; color: #333333;
} }
.symbol {
font-size: 20rpx;
} }
} }
} }
} }
}
.attention {
margin: 0 30rpx;
.attention-title {
position: relative;
font-weight: 600;
font-size: 32rpx;
color: #262626;
margin-bottom: 20rpx;
margin-left: 10rpx;
text {
margin-left: 14rpx;
}
&::before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 6rpx;
height: 100%;
border-radius: 4rpx;
background: #FF8056;
}
}
.attention-tips {
font-size: 24rpx;
color: #7A7A7A;
margin-bottom: 30rpx;
}
}
.member-btn {
position: fixed;
bottom: 0rpx;
left: 50%;
transform: translateX(-50%);
height: 110rpx;
background-color: #F6F6F6;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding-bottom: constant(safe-area-inset-bottom);
/* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */
.btn-wrap {
width: 670rpx;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
background: #EFCC6E;
border-radius: 40rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
}
}
}
</style> </style>
<template>
<view class="member">
<view class="card">
<view class="card-info">
<up-image width="100rpx" height="100rpx" />
<view class="card-info-right">
<view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view>
</view>
</view>
<view class="money">
<text>余额10000</text>
<view>充值</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text>当前已充值1000升级还需2000</text>
<text>Lv.2</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
<view class="charge-right">升级会员</view>
</view>
</view>
<!-- 充值规格 -->
<view class="rules">
<view class="rules-title">
<view class="rules-title-main">充值规格</view>
<view class="rules-title-record">
充值记录
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="rules-con">
<view class="rules-con-item" v-for="item in 4">
<view class="rules-con-item-main">基础会员</view>
<view class="rules-con-item-sub">永久</view>
<view class="rules-con-item-amount">
<text class="symbol"></text>
<text>1000</text>
</view>
</view>
<view class="rules-con-define">
<up-input placeholder="点击输入金额" type="number" color="#333" fontSize="28rpx"
:placeholderStyle="{color:'#989898'}">
<template #prefix>
<up-text text="自定义金额" color="#111" size="30rpx" margin="0 3px 0 0" type="tips"></up-text>
</template>
</up-input>
</view>
</view>
</view>
<!-- 注意事项 -->
<view class="attention">
<view class="attention-title"><text>注意事项</text></view>
<view class="attention-tips">1充值后帐户的金额不能提现可用于消费使用</view>
<view class="attention-tips">2账户充值出现问题可联系平台客服也可拨打平台客服咨询热线4008888888</view>
</view>
<view class="member-btn">
<view class="btn-wrap">
确认充值
</view>
</view>
</view>
</template>
<script>
import {
rechargeApi
} from "@/api/user.js";
rechargeApi({
price: 1000
}).then(res => {
console.log(res);
})
</script>

View File

@ -16,15 +16,15 @@
<view class="u-card-level"> <view class="u-card-level">
<view class="u-level-item"> <view class="u-level-item">
<view class="u-level-item-num">123</view> <view class="u-level-item-num">{{userInfo.vip_name}}</view>
<view class="u-level-item-txt">会员等级</view> <view class="u-level-item-txt">会员等级</view>
</view> </view>
<view class="u-level-item"> <view class="u-level-item">
<view class="u-level-item-num">123</view> <view class="u-level-item-num">{{userInfo.discount}}</view>
<view class="u-level-item-txt">可享折扣</view> <view class="u-level-item-txt">可享折扣</view>
</view> </view>
<view class="u-level-item"> <view class="u-level-item">
<view class="u-level-item-num">123</view> <view class="u-level-item-num">{{userInfo.now_money}}</view>
<view class="u-level-item-txt">可用余额</view> <view class="u-level-item-txt">可用余额</view>
</view> </view>
</view> </view>
@ -37,18 +37,22 @@
<up-image width="36rpx" height="36rpx" src="/static/icon/silver.webp"></up-image> <up-image width="36rpx" height="36rpx" src="/static/icon/silver.webp"></up-image>
<text>初级会员</text> <text>初级会员</text>
<up-line direction="col" color="#707070" margin="0 10rpx" length="12"></up-line> <up-line direction="col" color="#707070" margin="0 10rpx" length="12"></up-line>
<view>活动期间下单即享初级会员</view> <view :style="{'font-weight':userInfo.user_ship>0?'bold':'normal'}">
{{userInfo.user_ship>0?'享折扣权益':'活动期间下单即享初级会员'}}
</view>
</view>
<view class="member-right" @click="handleBack(userInfo.user_ship)">
{{userInfo.user_ship>0?'立即升级':'立即下单'}}
</view> </view>
<view class="member-right">立即下单</view>
</view> </view>
<view class="member-progress"> <view class="member-progress">
<view> <view>
<text>当前已充值1000升级还需2000</text> <text>当前已充值{{userInfo.total_recharge_amount}}升级还需{{userInfo.next_limit}}</text>
<text>Lv.2</text> <text>{{userInfo.next_level}}</text>
</view> </view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff" <up-line-progress :percentage="(userInfo.total_recharge_amount/userInfo.next_limit).toFixed(2)"
height="8rpx"></up-line-progress> activeColor="#A26341" inactiveColor="#fff" height="8rpx"></up-line-progress>
</view> </view>
</view> </view>
@ -130,6 +134,19 @@
}) })
} }
//
const handleBack = (e) => {
console.log(userInfo.user_ship);
if (e > 0) {
uni.navigateTo({
url: "/pages/charge/charge"
})
} else {
uni.navigateBack()
}
}
const navTo = (type = 0) => { const navTo = (type = 0) => {
uni.navigateTo({ uni.navigateTo({
url: `/pagesOrder/order/order?type=${type}` url: `/pagesOrder/order/order?type=${type}`

BIN
static/icon/account_bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
static/icon/charge_bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

BIN
static/icon/diamond.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/icon/order.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB