调整个人中心页面,会议中心页面,充值页面

This commit is contained in:
2025-09-26 17:57:14 +08:00
parent a39c9f4d72
commit 905d5404f6
20 changed files with 1397 additions and 230 deletions

View File

@@ -0,0 +1 @@
export const prveUrl='/account'

View File

@@ -0,0 +1,13 @@
// 引入 request 文件
import request from '@/common/api/request.js'
import {prveUrl} from './config.js'
export const pointsShopList = (data) => {
return request({
url: prveUrl + '/user/shopUser/pointsShopList',
method: 'get',
data: data
})
}

View File

@@ -3,10 +3,17 @@ import request from '@/common/api/request.js'
import {prveUrl} from './config.js'
export const config = (data) => {
const shopId=uni.getStorageSync('shopId')||'';
return request({
url: prveUrl + '/user/recharge/config',
method: 'get',
data: {...data,shopId:shopId}
data: data
})
}
export const list = (data) => {
return request({
url: prveUrl + '/user/recharge/list',
method: 'get',
data: data
})
}

View File

@@ -1,6 +1,18 @@
// 引入 request 文件
import request from '@/common/api/request.js'
const url = '/order'
let platformType = '';
let payType='';
// #ifdef MP-WEIXIN
platformType = 'wechat'
payType='wechatPay'
// #endif
// #ifdef MP-ALIPAY
platformType = 'alipay'
payType='aliPay'
// #endif
//订单列表
export const APIuserorder = (data) => {
return request({
@@ -70,4 +82,30 @@ export const joinMember = (data) => {
method: 'post',
data: data
})
}
//会员购买支付
export const ltPayMember = (data) => {
return request({
url: url + '/pay/ltPayMember',
method: 'post',
data: {
platformType,
payType,
openId: uni.cache.get('miniAppOpenId'),
...data
}
})
}
//智慧充值
export const recharge = (data) => {
return request({
url: url + '/pay/recharge',
method: 'post',
data: {
platformType,
payType,
openId: uni.cache.get('miniAppOpenId'),
...data
}
})
}

View File

@@ -103,6 +103,12 @@
"navigationBarTitleText": "会员列表"
}
},
{
"path": "pages/user/member/amount-list",
"style": {
"navigationBarTitleText": "储值列表"
}
},
{
"path": "pages/user/member/memberdetails",
"style": {
@@ -216,6 +222,13 @@
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "score/list",
"style" :
{
"navigationBarTitleText" : "积分门店"
}
}
]

View File

@@ -10,8 +10,9 @@
<text class="contentboxitemlefttexttow">在线点不排队</text>
</view>
<view class="contentboxitemright">
<view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/memberdetails')">
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/memberdetails')"> -->
<view class="contentboxitemright_item flex-between" @click="tomember">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
</image>
<view class="contentboxitemright_itembox flex-colum">
@@ -19,7 +20,11 @@
<text>入会享权益</text>
</view>
</view>
<view class="contentboxitemright_item flex-between" @click="memberindex('user/member/index')">
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/index')"
> -->
<view class="contentboxitemright_item flex-between" @click="toCharge">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
mode="aspectFill"></image>
<view class="contentboxitemright_itembox flex-colum">
@@ -65,6 +70,27 @@
type: 'index',
})
}
function tomember() {
const shopUserInfo = uni.cache.get('shopUserInfo')||{}
const shopId = uni.cache.get('shopId')
if(!shopUserInfo.isVip){
uni.navigateTo({
url: '/user/vip/buy-vip?shopId=' + shopId
})
return
}
uni.navigateTo({
url: '/user/vip/vip?shopId=' + shopId
})
}
function toCharge() {
const shopId = uni.cache.get('shopId')
uni.navigateTo({
url: '/pages/user/member/czzx?shopId='+shopId
})
}
const getQueryString = (url, name) => { //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg)

View File

@@ -115,7 +115,7 @@
left: 0;
width: 100%;
height: 100%;
z-index: 999;
z-index: 9999;
}
.modal-mask {

View File

@@ -852,6 +852,8 @@
} catch (error) {
//TODO handle the exception
}
orderorderInfo()
});
let options = {}

View File

@@ -0,0 +1,171 @@
<template>
<view class="content">
<view class="onecontentone">
我的储值卡<text v-if="orderForm.list.length!=0">({{orderForm.list.length}})</text>
</view>
<view class="flex-colum">
<view class="towcontentitem" v-if="orderForm.list.length>0" v-for="(item,index) in orderForm.list"
:key="index" @click="eeInfo(item)">
<image class="towcontentitemimage"
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
<view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
<!-- 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
<text>{{item.shopName}}</text>
</view>
</view>
</view>
<view v-if="orderForm.list.length <= 0 " class="flex-colum">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted
} from 'vue';
import {
onReachBottom
} from '@dcloudio/uni-app'
import {
APIusershopUservipCard
} from '@/common/api/member.js'
import * as rechargeApi from '@/common/api/market/recharge.js'
const orderForm = reactive({
type: '', //类型
list: [],
is_end: false,
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
}
})
const paygetShopByMember = async () => {
let res = await rechargeApi.list({
page: orderForm.form.page,
pageSize: orderForm.form.size,
})
orderForm.list = res;
}
const eeInfo = async (item) => {
uni.navigateTo({
url:'/pages/user/member/czzx?shopId='+item.shopId
})
}
onReachBottom(() => {
// paygetShopByMember()
})
onMounted((e) => {
paygetShopByMember()
})
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.content {
border-top: 16rpx solid #f7f7f7;
padding: 28rpx;
padding-bottom: 40rpx;
.flex-colum_image {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
text {
margin-top: 30rpx;
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #666666;
}
}
.onecontentone {
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
}
.flex-colum {
.towcontentitem {
margin-top: 22rpx;
width: 96%;
position: relative;
height: 224rpx;
padding: 32rpx;
border-radius: 12rpx;
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 9;
}
.towcontentitemone {
position: relative;
z-index: 10;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
width: 60%;
margin-left: 16rpx;
font-size: 32rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #422A07;
}
}
.towcontentitemtow {
z-index: 10;
position: absolute;
width: 100%;
left: 0;
bottom: 18rpx;
padding: 0 32rpx;
// margin-top: 52rpx;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
}
</style>

View File

@@ -0,0 +1,306 @@
<template>
<!-- 账单明细 -->
<view style="padding-bottom: 40rpx;">
<up-navbar bgColor="transparent" title="明细" @leftClick="back"></up-navbar>
<view class="bild" style="background-image: url(/static/czzx_header_bg.png);">
<view class="bildLeft">
<text>我的余额</text>
<view>{{formData.info.amount||0}}</view>
</view>
<view class="bildRight">
<text>我的积分</text>
<view>{{formData.info.accountPoints||0}}</view>
</view>
</view>
<view class="bottom">
<view class="navTop">
<view @click="clickEvent(1)" :class="[formData.active==1?'fonts':'']">
余额明细
<view :class="[formData.active==1?'xian':'']" style="left: 36rpx;"> </view>
</view>
<view @click="clickEvent(2)" :class="[formData.active==2?'fonts':'']">
积分明细
<view :class="[formData.active==2?'xian':'']" style="left: 36rpx;"> </view>
</view>
</view>
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
<view class="flex-start">
<view class="listStyle_left">
<view class="listrigth">
<view v-if="formData.active == 1">
<text v-if="item.bizCode == 'cashIn'">
现金充值
</text>
<text v-if="item.bizCode == 'wechatIn'">
微信小程序充值
</text>
<text v-if="item.bizCode == 'alipayIn'">
支付宝小程序充值
</text>
<text v-if="item.bizCode == 'awardIn'">
充值奖励
</text>
<text v-if="item.bizCode == 'rechargeRefund'">
充值退款
</text>
<text v-if="item.bizCode == 'orderPay'">
订单消费
</text>
<text v-if="item.bizCode == 'orderRefund'">
订单退款
</text>
<text v-if="item.bizCode == 'adminIn'">
管理员充值
</text>
<text v-if="item.bizCode == 'adminOut'">
管理员消费
</text>
</view>
<view v-else>
{{item.content}}
</view>
<view v-if="formData.active == 1" :class="{colorStyle: (item.bizCode == 'cashIn' || item.bizCode == 'wechatIn' ||
item.bizCode == 'alipayIn'|| item.bizCode == 'awardIn'|| item.bizCode == 'rechargeRefund')}">
{{ item.amount }}
</view>
<view v-else :class="{colorStyle: (item.floatPoint>0)}">
{{item.floatPoints}}
</view>
</view>
</view>
<view class=" listrigth2">
<view>{{item.createTime}}
</view>
<view v-if="formData.active == 1">余额:{{item.balance}}</view>
</view>
</view>
</view>
<view v-if="formData.list.length <= 0" style="text-align: center;">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<up-loadmore :status="formData.form.status" fontSize="14" color="#999" iconSize="14" />
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted
} from 'vue'
import {
onReachBottom
} from '@dcloudio/uni-app'
import {
APIshopUsermoneyRecord,
APIshopUserpointsRecord
} from '@/common/api/member.js'
function back(){
uni.navigateBack()
}
const formData = reactive({
active: 1,
list: [],
form: {
page: 1,
size: 10,
status: 'loadmore',
},
info: {
amount: '',
accountPoints: ''
},
shopId: null
})
const getlist = async () => {
let res = null
if (formData.active == 1) {
res = await APIshopUsermoneyRecord({
page: formData.form.page,
size: formData.form.size,
// status: formData.status,
shopId: formData.shopId
})
} else {
res = await APIshopUserpointsRecord({
page: formData.form.page,
size: formData.form.size,
// status: formData.form.status,
shopId: formData.shopId
})
}
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
formData.form.status = 'nomore'
formData.list = res.records
if (formData.form.page == 1 && res.records.length == 0) {
formData.records = []
formData.is_end = true
}
return false;
} else {
formData.form.status = 'loading';
if (formData.form.page == 1) {
formData.list = res.records
} else {
formData.list = [...formData.list, ...res.records];
}
formData.form.page = ++formData.form.page;
if (formData.form.page > res.totalPage) {
formData.form.status = 'nomore';
} else {
formData.form.status = 'loading';
}
}
}
// 检测是否包含In
const checkIn = (str) => {
let reg = RegExp(/In/)
return str.match(reg)
}
const clickEvent = (i) => {
formData.active = i;
formData.form.page = 1;
formData.is_end = false
formData.form.page = 1
formData.form.size = 10
formData.form.status = 'loadmore'
getlist()
}
onReachBottom(() => {
getlist()
})
onMounted(() => {
// 获取当前页面栈
const pages = getCurrentPages();
// 获取当前页面实例
const currentPage = pages[pages.length - 1];
// 获取页面参数
const options = currentPage.options;
formData.info = JSON.parse(decodeURIComponent(options.shopInfo))
formData.shopId = options.shopId
formData.active = options.type
console.log(formData.info)
getlist()
})
</script>
<style scoped lang="less">
.bild {
height: 500rpx;
background-size: cover;
display: flex;
justify-content: space-around;
align-items: center;
.bildLeft,
.bildRight {
font-weight: 400;
font-size: 32rpx;
>view,
>text {
text-align: center;
color: #333;
}
>view {
margin-top: 34rpx;
font-weight: bold;
}
}
}
.bottom{
background-color: rgba(255, 255, 255, .3);
padding: 40rpx 28rpx 0 28rpx;
transform: translateY(-140rpx);
border-radius: 74rpx 74rpx 0 0;
}
.navTop {
display: flex;
justify-content: space-around;
align-items: center;
color: #333;
font-size: 28rpx;
.fonts {
font-size: 32rpx;
}
>view {
position: relative;
.xian {
width: 58rpx;
height: 6rpx;
background: #FFAA62;
border-radius: 2rpx 2rpx 2rpx 2rpx;
position: absolute;
bottom: -16rpx;
}
}
}
.listStyle {
padding: 28rpx;
padding-top: 50rpx;
width: 100%;
.listrigth,
.listrigth2 {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
// padding-left: 32rpx;
}
.listrigth {
.colorStyle {
color: #FF7127;
}
>view {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
}
.listStyle_left {
width: 100%;
display: flex;
align-items: center;
}
.head_img {
border-radius: 50%;
margin-right: 32rpx;
}
.listrigth2 {
margin-top: 16rpx;
>view {
font-weight: 500;
font-size: 24rpx;
color: #666666;
}
}
}
</style>

View File

@@ -5,11 +5,11 @@
<view class="bild" style="background-image: url(/static/czzx_header_bg.png);">
<view class="bildLeft">
<text>我的余额</text>
<view>{{formData.info.amount||0}}</view>
<view>{{shopUserInfo.amount||0}}</view>
</view>
<view class="bildRight">
<text>我的积分</text>
<view>{{formData.info.accountPoints||0}}</view>
<view>{{shopUserInfo.accountPoints||0}}</view>
</view>
</view>
<view class="bottom">
@@ -92,16 +92,19 @@
reactive,
onMounted
} from 'vue'
import {
onReachBottom
onReachBottom,onLoad
} from '@dcloudio/uni-app'
import {
APIshopUsermoneyRecord,
APIshopUserpointsRecord
} from '@/common/api/member.js'
import {
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
function back(){
uni.navigateBack()
@@ -181,20 +184,27 @@
onReachBottom(() => {
getlist()
})
onMounted(() => {
// 获取当前页面栈
const pages = getCurrentPages();
// 获取当前页面实例
const currentPage = pages[pages.length - 1];
// 获取页面参数
const options = currentPage.options;
formData.info = JSON.parse(decodeURIComponent(options.shopInfo))
const shopUserInfo=reactive({})
async function getShopUserInfo(){
const res=await APIshopUserInfo({
shopId: options.shopId
})
if(res){
Object.assign(shopUserInfo,res)
}
}
const options=reactive({})
onLoad((opt)=>{
Object.assign(options,opt)
console.log('options',options);
formData.shopId = options.shopId
formData.active = options.type
console.log(formData.info)
getlist()
getShopUserInfo()
})
</script>
<style scoped lang="less">

View File

@@ -7,18 +7,18 @@
<view class="select-shop">
<view class="select-btn">
<up-icon name="map" color="#333"></up-icon>
<text class="t">双屿Pisces</text>
<text class="t">{{shopInfo.shopName}}</text>
<up-icon name="arrow-right" color="#333"></up-icon>
</view>
</view>
<view class="balance-wrap">
<view class="left">
<text class="i t">余额</text>
<text class="n t">12223.53</text>
<text class="n t">{{shopUserInfo.amount}}</text>
</view>
<view class="right">
<text class="t">明细</text>
<text class="t">密码设置</text>
<text class="t" @click="toDetail">明细</text>
<text class="t" @click="toPwd">密码设置</text>
</view>
</view>
<view class="btm-wrap">
@@ -82,7 +82,7 @@
<view>充值说明</view>
<view class="u-m-t-16">
<text>适用门店</text>
<text class="color2 u-m-l-28">全国门店通用 > </text>
<text class="color2 u-m-l-28">全国门店通用 {{'>'}} </text>
</view>
<view class="u-m-t-16">
<text>有效期限</text>
@@ -92,16 +92,16 @@
<text class="no-wrap">注意事项</text>
<view class="u-m-l-28">
<view>1.储值完成后不支持自助退款可联系商家处理</view>
<view> 2.余额不支持转赠不可提现长期有效</view>
<view> 2.余额不支持转赠不可提现长期有效</view>
</view>
</view>
<view class="u-m-t-16 u-flex u-flex-y-center">
<text class="no-wrap">充值说明</text>
<view class="u-m-l-28">
此处显示内容:管理端配置读取智慧充值中充值说明字段内容
{{state.remark||''}}
</view>
</view>
</view>
</view>
@@ -110,35 +110,134 @@
</template>
<script setup>
import * as vipApi from '@/common/api/market/recharge.js'
import {joinMember} from '@/common/api/order/index.js'
import {
ref,onMounted,computed
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
import * as rechargeApi from '@/common/api/market/recharge.js'
import {
recharge
} from '@/common/api/order/index.js'
import {
joinMember
} from '@/common/api/order/index.js'
import {
ref,
onMounted,
computed,
reactive,
watch
} from 'vue'
async function buy(){
const res=await joinMember()
import {
onLoad
} from '@dcloudio/uni-app'
import {
pay
} from '@/utils/pay.js'
async function buy() {
if (!charge_money.value) {
return uni.showToast({
title: '请选择或者输入充值金额',
icon: 'none'
})
}
const json = {
shopId: option.shopId,
shopUserId: shopUserInfo.id,
}
if (sel.value < 0) {
json.amount = `${money.value}`.trim()*1
} else {
json.rechargeDetailId = list.value[sel.value].id
json.amount = list.value[sel.value].amount
}
const res = await recharge(json)
if (!res) {
return uni.showToast({
title: '充值失败',
icon: 'error'
})
}
const payRes = await pay(res)
console.log(payRes);
if (payRes) {
uni.showToast({
title: '充值成功',
icon: 'none'
})
init()
}
}
function toDetail() {
uni.navigateTo({
url: '/pages/user/member/billDetails?type=1&shopId=' + option.shopId
})
}
function toPwd() {
uni.navigateTo({
url: '/pages/user/member/setPassword?type=1&shopId=' + option.shopId
})
}
function back() {
uni.navigateBack();
}
const list = ref([])
const sel = ref(0)
const money = ref(null);
async function init(){
const res=await vipApi.config()
if(res){
list.value=res.rechargeDetailList
const option = reactive({
shopId: ''
})
const shopInfo = reactive({})
const shopUserInfo = reactive({})
const state = reactive({})
async function init() {
const shopInfoRes = await APIusershopInfodetail({
shopId: option.shopId
})
if (shopInfoRes) {
Object.assign(shopInfo, shopInfoRes.shopInfo)
}
const shopUserInfoRes = await APIshopUserInfo({
shopId: option.shopId
})
if (shopUserInfoRes) {
Object.assign(shopUserInfo, shopUserInfoRes)
}
const res = await rechargeApi.config({
shopId: option.shopId
})
if (res) {
Object.assign(state, res)
list.value = res.rechargeDetailList
}
}
const charge_money=computed(()=>{
const item= list.value[sel.value]
if(item){
const charge_money = computed(() => {
if (sel.value < 0) {
if (money.value > 0) {
return money.value
}
return ''
}
const item = list.value[sel.value]
if (item) {
return item.amount
}
return ''
})
onMounted(init)
onLoad((opt) => {
Object.assign(option, opt)
init()
})
watch(() => money.value, (newval) => {
if (newval && newval > 0) {
sel.value = -1
}
})
</script>
<style scoped lang="scss">
@@ -172,7 +271,7 @@
width: 100%;
height: 530rpx;
box-sizing: border-box;
padding: calc(var(--status-bar-height) + 180upx) 28upx 28upx;
padding: calc(var(--status-bar-height) + 140rpx) 28rpx 28rpx;
position: relative;
.bg {

View File

@@ -0,0 +1,207 @@
<template>
<view class="content">
<view class="onecontentone">
我的会员卡<text v-if="orderForm.list.length!=0">({{orderForm.list.length}})</text>
</view>
<view class="flex-colum">
<view class="towcontentitem" v-if="orderForm.list.length>0" v-for="(item,index) in orderForm.list"
:key="index" @click="eeInfo(item)">
<image class="towcontentitemimage"
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
<view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
<!-- 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
<text>{{item.shopName}}</text>
</view>
</view>
</view>
<view v-if="orderForm.list.length <= 0 && orderForm.is_end" class="flex-colum">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<up-loadmore :status="orderForm.form.status" iconSize='12' fontSize='12' height='20' />
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted
} from 'vue';
import {
onReachBottom
} from '@dcloudio/uni-app'
import {
APIusershopUservipCard
} from '@/common/api/member.js'
const orderForm = reactive({
type: '', //类型
list: [],
is_end: false,
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
}
})
const paygetShopByMember = async () => {
let res = await APIusershopUservipCard({
page: orderForm.form.page,
pageSize: orderForm.form.size,
})
if (res.totalPage == 1 && res.totalRow <= 10) {
orderForm.form.status = 'nomore'
orderForm.list = res.records
if (orderForm.form.page == 1 && res.records.length == 0) {
orderForm.records = []
orderForm.is_end = true
}
return false;
} else {
orderForm.form.status = 'loading';
orderForm.list = [...orderForm.list, ...res.records];
orderForm.form.page = ++orderForm.form.page;
if (orderForm.form.page > res.totalPage) {
orderForm.form.status = 'nomore';
} else {
orderForm.form.status = 'loading';
}
}
}
const eeInfo = async (item) => {
// if (res.code == 0) {
// uni.cache.set('shopUserInfo', res)
// uni.cache.set('shopId', item.shopId)
if (orderForm.type && orderForm.type == 'user_payCode') {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(item)
})
} else if (orderForm.type && orderForm.type == 'user_recharge') {
uni.pro.navigateTo('member/index', {
shopId: item.shopId,
type: 'index',
})
} else if (orderForm.type && orderForm.type == 'user_points') {
uni.pro.navigateTo('/pagesPoints/index/index', {
shopId: item.shopId,
type: 'member_list',
})
} else {
uni.pro.navigateTo('user/member/memberdetails', {
shopId: item.shopId
})
}
}
onReachBottom(() => {
paygetShopByMember()
})
onMounted((e) => {
paygetShopByMember()
})
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.content {
border-top: 16rpx solid #f7f7f7;
padding: 28rpx;
padding-bottom: 40rpx;
.flex-colum_image {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
text {
margin-top: 30rpx;
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #666666;
}
}
.onecontentone {
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
}
.flex-colum {
.towcontentitem {
margin-top: 22rpx;
width: 96%;
position: relative;
height: 224rpx;
padding: 32rpx;
border-radius: 12rpx;
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 9;
}
.towcontentitemone {
position: relative;
z-index: 10;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
width: 60%;
margin-left: 16rpx;
font-size: 32rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #422A07;
}
}
.towcontentitemtow {
z-index: 10;
position: absolute;
width: 100%;
left: 0;
bottom: 18rpx;
padding: 0 32rpx;
// margin-top: 52rpx;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
}
</style>

View File

@@ -14,16 +14,16 @@
<!-- 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
<text></text>
<!-- <text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text> -->
<text>{{item.shopName}}</text>
</view>
</view>
</view>
<view v-if="orderForm.list.length <= 0 && orderForm.is_end" class="flex-colum">
<view v-if="orderForm.list.length <= 0 " class="flex-colum">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<up-loadmore :status="orderForm.form.status" iconSize='12' fontSize='12' height='20' />
</view>
</template>
@@ -41,6 +41,8 @@
import {
APIusershopUservipCard
} from '@/common/api/member.js'
import * as vipApi from '@/common/api/market/vip.js'
const orderForm = reactive({
type: '', //类型
@@ -55,58 +57,21 @@
const paygetShopByMember = async () => {
let res = await APIusershopUservipCard({
let res = await vipApi.list({
page: orderForm.form.page,
pageSize: orderForm.form.size,
})
if (res.totalPage == 1 && res.totalRow <= 10) {
orderForm.form.status = 'nomore'
orderForm.list = res.records
if (orderForm.form.page == 1 && res.records.length == 0) {
orderForm.records = []
orderForm.is_end = true
}
return false;
} else {
orderForm.form.status = 'loading';
orderForm.list = [...orderForm.list, ...res.records];
orderForm.form.page = ++orderForm.form.page;
if (orderForm.form.page > res.totalPage) {
orderForm.form.status = 'nomore';
} else {
orderForm.form.status = 'loading';
}
}
orderForm.list = res;
}
const eeInfo = async (item) => {
// if (res.code == 0) {
// uni.cache.set('shopUserInfo', res)
// uni.cache.set('shopId', item.shopId)
if (orderForm.type && orderForm.type == 'user_payCode') {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(item)
})
} else if (orderForm.type && orderForm.type == 'user_recharge') {
uni.pro.navigateTo('member/index', {
shopId: item.shopId,
type: 'index',
})
} else if (orderForm.type && orderForm.type == 'user_points') {
uni.pro.navigateTo('/pagesPoints/index/index', {
shopId: item.shopId,
type: 'member_list',
})
} else {
uni.pro.navigateTo('user/member/memberdetails', {
shopId: item.shopId
})
}
uni.navigateTo({
url:'/user/vip/vip?shopId='+item.shopId
})
}
onReachBottom(() => {
paygetShopByMember()
// paygetShopByMember()
})
onMounted((e) => {
paygetShopByMember()

View File

@@ -8,15 +8,18 @@
<view class="text">获取手机号</view>
</button>
</view> -->
<view class="u-flex">
<view class="u-p-r-40">
<view class="color-333 font-16 font-700">密码支付</view>
<view class="font-12 color-999 u-m-t-4">关闭时使用余额支付将会直接扣除不再进行确认</view>
</view>
<up-switch v-model="form.isOpen" active-color="#FFD158" :inactive-value="0"
:active-value="1"></up-switch>
</view>
<view class="color-333 font-16 font-700" style="margin-top: 60rpx;">密码支付</view>
<view class="box_item flex-between">
<text class="top_box_one_text">当前账号</text>
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" :disabled="true" />
</view>
<view class="box_item flex-between" style="position:relative;">
<text class="top_box_one_text"></text>
<input type="number" v-model="form.checkCode" placeholder="请输入验证码"
style="padding-right: 140rpx;color: #333" />
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" :disabled="true" />
<view class="top_box_one_texts">
<view v-if="datalist.showText == true" class="yzm" @click="CodeRegister">{{ datalist.Recapture }}
</view>
@@ -25,6 +28,12 @@
</view>
</view>
</view>
<view class="box_item flex-between" style="position:relative;">
<text class="top_box_one_text"></text>
<input type="number" v-model="form.checkCode" placeholder="请输入验证码"
style="padding-right: 140rpx;color: #333" />
</view>
<view class="box_item flex-between">
<text class="top_box_one_text">新密码</text>
<input type="number" v-model="form.password" placeholder="请输入6位数字交易密码" maxlength="6"
@@ -56,7 +65,7 @@
import {
APIshopUserInfo
} from '@/common/api/member.js'
import {
productStore
} from '@/stores/user.js';
@@ -70,7 +79,8 @@
mobile: uni.cache.get('orderVIP').phone,
password: '',
payPassword: '',
checkCode: ''
checkCode: '',
isOpen: 1
})
const datalist = reactive({
@@ -193,34 +203,12 @@
uni.navigateBack()
}
}
onMounted(async () => {
// 获取当前页面栈
const pages = getCurrentPages();
// 获取当前页面实例
const currentPage = pages[pages.length - 1];
// 获取页面参数
const options = currentPage.options;
// if (options.shopId) {
// let res = await APIshopUserInfo({F
// shopId: options.shopId
// })
// uni.cache.set('shopId', options.shopId, 30)
// uni.cache.set('orderVIP', res)
// uni.cache.set('ordershopUserInfo', res.shopInfo)
// } else {
// shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
// }
})
</script>
<style lang="scss">
page {
background: #f9f9f9;
}
<style lang="scss" scoped>
.Box {
padding: 0 28rpx;
padding: 80rpx 28rpx 28rpx;
.box_one {
margin-top: 26rpx;
@@ -232,10 +220,9 @@
.box_box {
background: #fff;
padding: 0 32rpx;
.box_item {
border-bottom: 1rpx solid #E5E5E5;
// border-bottom: 1rpx solid #E5E5E5;
position: relative;
.top_box_one_text {
@@ -321,4 +308,13 @@
z-index: 2;
}
}
.Box .box_box .box_item uni-input{
border-bottom: 1rpx solid #E5E5E5;
}
.Box .box_box .box_item input{
border-bottom: 1rpx solid #E5E5E5;
}
:deep(.Box .box_box .box_item uni-input){
border-bottom: 1rpx solid #E5E5E5;
}
</style>

View File

@@ -22,7 +22,7 @@
<up-gap height="26rpx" bg-color="#F9F9F9"></up-gap>
<!-- <view class="my_item my_assets" @click="Myassets"> -->
<view class="my_item my_assets" >
<view class="my_item my_assets">
<view class="my_item_title u-m-t-12">我的资产</view>
<view class="amount">
<view class="u-flex u-flex-between u-m-t-20">
@@ -33,25 +33,27 @@
</image>
<text class="color-333 font-14 u-m-l-20">储值</text>
</view>
<view class="u-flex color-666">
<text class="font-12 u-m-r-4">3家店</text>
<view class="u-flex color-666" @click="toChargeList">
<text class="font-12 u-m-r-4">{{rechargeList.length}}家店</text>
<up-icon name="arrow-down" color="#666" size="12px"></up-icon>
</view>
</view>
<view class="card-list">
<view class="card-list-item" v-for="(item,index) in 3" :key="index">
<up-image radius="20rpx" width="182rpx" height="182rpx"></up-image>
<view class="card-list-item" v-for="(item,index) in rechargeList" :key="index"
@click="toCharge(item)">
<up-image radius="20rpx" width="182rpx" height="182rpx" :src="item.logo"> </up-image>
<view class="info text-center">
<view class="color-333 u-m-t-14 ">
<text class="font-10">¥</text>
<text class="font-16 font-700 ">9999.99</text>
<text class="font-16 font-700 ">{{item.amount}}</text>
</view>
<view class="font-12 color-666">这里是店铺名称</view>
<view class="font-12 color-666 u-line-1">{{item.shopName}}</view>
</view>
</view>
<view class="u-flex u-flex-column u-flex-center">
<view class="u-flex u-flex-column u-flex-center" style="width: 12px;" v-if="rechargeList.length"
@click="toChargeList">
<view class="text-center color-333 font-12">查看全部</view>
</view>
</view>
@@ -63,25 +65,22 @@
</image>
<text class="color-333 font-14 u-m-l-20">会员</text>
</view>
<view class="u-flex color-666">
<text class="font-12 u-m-r-4">3家店</text>
<view class="u-flex color-666" @click="tomemberList">
<text class="font-12 u-m-r-4">{{memberList.length}}家店</text>
<up-icon name="arrow-down" color="#666" size="12px"></up-icon>
</view>
</view>
<view class="card-list">
<view class="card-list-item" v-for="(item,index) in 3" :key="index">
<up-image radius="20rpx" width="182rpx" height="182rpx"></up-image>
<view class="card-list-item" v-for="(item,index) in memberList" :key="index"
@click="tomember(item)">
<up-image radius="20rpx" width="182rpx" height="182rpx" :src="item.logo"></up-image>
<view class="info text-center">
<view class="color-333 u-m-t-14 ">
<text class="font-10">¥</text>
<text class="font-16 font-700 ">9999.99</text>
</view>
<view class="font-12 color-666">这里是店铺名称</view>
<view class="font-12 color-666 u-m-t-14 u-line-1">{{item.shopName}}</view>
</view>
</view>
<view class="u-flex u-flex-column u-flex-center">
<view class="u-flex u-flex-column u-flex-center" style="width: 12px;" v-if="memberList.length">
<view class="text-center color-333 font-12" @click="tomemberList">查看全部</view>
</view>
</view>
@@ -129,11 +128,15 @@
productStore
} from '@/stores/user.js';
import * as vipApi from '@/common/api/market/vip.js'
import * as rechargeApi from '@/common/api/market/recharge.js'
const store = productStore();
const myFunList = ref([{
name: "积分",
type: "score",
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png",
url: '/user/score/list'
},
{
name: "优惠券",
@@ -162,26 +165,32 @@
const userInfo = reactive({})
const ShopId = ref(uni.cache.get('shopId'))
function tomemberList(){
console.log('ShopId', uni.cache.get('shopId'))
function tomemberList() {
uni.navigateTo({
url:'/pages/user/member/list'
url: '/pages/user/member/list'
})
}
function tomember(item) {
uni.navigateTo({
url: '/user/vip/vip?shopId=' + item.shopId
})
}
const clickEvent = () => {
if (ShopId.value) {
if(!userInfo.isVip){
if (!userInfo.isVip) {
uni.navigateTo({
url: '/user/vip/buy-vip?shopId='+ShopId.value
url: '/user/vip/buy-vip?shopId=' + ShopId.value
})
}else{
} else {
uni.navigateTo({
url: '/user/vip/vip?shopId='+ShopId.value
url: '/user/vip/vip?shopId=' + ShopId.value
})
}
// if (userInfo.isVip == 0) {
@@ -216,7 +225,26 @@
}
}
function toCharge(item) {
uni.navigateTo({
url: '/pages/user/member/czzx?shopId=' + item.shopId
})
}
function toChargeList() {
uni.navigateTo({
url: '/pages/user/member/amount-list'
})
}
const clickTo = (item, index) => {
if (item.url) {
uni.navigateTo({
url:item.url
})
return
}
let shopId = null;
switch (item.type) {
case 'my_order':
@@ -267,9 +295,14 @@
break;
}
}
const memberList = ref([])
const rechargeList = ref([])
async function getData() {
const res = await vipApi.list()
console.log(res);
memberList.value = res.slice(0, 3);
const res1 = await rechargeApi.list()
rechargeList.value = res1.slice(0, 3);
}
onShow(() => {
store.actionsAPIuser()
@@ -450,9 +483,11 @@
.card-list-item {
max-width: 182rpx;
box-shadow: 8rpx 8rpx 32rpx 0 #0b18390f;
border-radius: 0 0 20rpx 20rpx;
.info {
padding-bottom: 16rpx;
border-radius: 0 0 20rpx 20rpx;
overflow: hidden;
}
}

72
user/score/list.vue Normal file
View File

@@ -0,0 +1,72 @@
<template>
<view class="box">
<up-search v-model="query.shopName" @search="getData" @custom="getData"></up-search>
<view class="u-m-t-32">
<view class="u-flex list-item" v-for="(item,index) in list" :key="index">
<up-avatar size="84rpx" shape="square" round="16rpx" :src="item.logo"></up-avatar>
<view class="u-p-l-8 u-flex-1 u-flex u-flex-between">
<view>
<view class="color-333 font-14">{{item.shopName}}</view>
<view class="color-666 font-12 u-m-t-8">可用积分{{item.accountPoints}}</view>
</view>
<view class="color-1 font-14">
<view class="" @click="toDetail(item)">积分明细</view>
<view class="u-m-t-8" @click="toDuihuan(item)">去兑换</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
pointsShopList
} from '@/common/api/account/points.js'
import {
onMounted,
reactive,
ref
} from 'vue';
const list = ref([])
const query = reactive({
shopName: ''
})
async function getData() {
const res = await pointsShopList(query)
if (res) {
list.value = res || []
}
}
function toDuihuan() {
uni.showToast({
title: '待开放!',
icon: 'none'
})
}
function toDetail(item) {
uni.navigateTo({
url: '/pages/user/member/billDetails?type=2&shopId=' + item.shopId
})
}
onMounted(getData)
</script>
<style lang="scss" scoped>
.box {
padding: 32rpx 28rpx;
}
.color-1 {
color: #FF6300;
}
.list-item {
padding: 36rpx 0;
border-bottom: 1px solid #EDEDED;
}
</style>

View File

@@ -146,11 +146,13 @@
computed
} from "vue"
import {
joinMember
joinMember,
ltPayMember
} from '@/common/api/order/index.js'
import * as vipApi from '@/common/api/market/vip.js'
import {pay} from '@/utils/pay.js'
import {
APIusershopInfodetail
APIusershopInfodetail,APIshopUserInfo
} from '@/common/api/member.js'
import {
onLoad
@@ -162,8 +164,8 @@
show1: false,
title: ''
})
const memberOpen=ref(false)
const memberOpen = ref(false)
function modelHide() {
model.show = false;
@@ -278,7 +280,14 @@
}
const memberLevel = ref(null)
const shopInfo = reactive({})
const shopUserInfo = ref({})
async function init(shopId) {
const userRes= await APIshopUserInfo({
shopId
})
if (userRes) {
shopUserInfo.value=userRes
}
const shopRes = await APIusershopInfodetail({
shopId
})
@@ -289,8 +298,10 @@
shopId: shopId
})
if (res) {
if(res.memberConfig.isSubmitInfo){
memberOpen.value=true;
if (res.memberConfig.isSubmitInfo && (shopUserInfo.value.sex === null || shopUserInfo.value.sex ===
undefined || !shopUserInfo.value.nickName || !shopUserInfo.value.birthDay || !shopUserInfo.value
.phone)) {
memberOpen.value = true;
}
conditionList.value = res.memberConfig.conditionList.map(v => {
const json = {
@@ -335,33 +346,49 @@
onLoad((opt) => {
Object.assign(option, opt)
console.log(option);
let shopId = uni.cache.get('shopId')
if (opt.shopId) {
shopId = opt.shopId
}
if (shopId) {
option.shopId = shopId
}
let shopId = option.shopId
init(shopId)
})
let userInfo = {}
function emitsmemberOpen(e){
memberOpen.value=false
userInfo=e
function emitsmemberOpen(e) {
memberOpen.value = false
Object.assign(shopUserInfo.value,e)
}
async function buy() {
const json = {
shopId: option.shopId,
name: configList.value[vipSel.value].name,
num: 1,
shopId: option.shopId,
shopUserId: shopUserInfo.value.id
}
if (state.isSubmitInfo) {
json.sex = userInfo.sex ;
json.birthDay = userInfo.birthDay;
json.nickName = userInfo.nickName
json.sex = shopUserInfo.value.sex;
json.birthDay = shopUserInfo.value.birthDay;
json.nickName = shopUserInfo.value.nickName
}
const res = await ltPayMember(json)
if (!res) {
return uni.showToast({
title: '购买失败',
icon:'error'
})
}
const payRes=await pay(res)
console.log(payRes);
if(payRes){
uni.showToast({
title: '开通会员成功',
icon:'none'
})
setTimeout(()=>{
uni.redirectTo({
url:'/user/vip/vip?shopId='+option.shopId
})
},1000)
}
const res = await joinMember(json)
}
</script>

View File

@@ -7,23 +7,27 @@
<image src="/user/static/image_21.png" class="huangguan" mode=""></image>
</view>
<view class="tag">当前等级</view>
<view class="shop-name">店铺名称</view>
<view class="lv">白银会员</view>
<view class="time">
<text>2025.10.14到期 </text>
<text>月度会员</text>
<view class="u-p-l-22">
<view class="shop-name">{{shopInfo.shopName}}</view>
<view class="lv">{{memberLevel?memberLevel.name:''}}</view>
<view class="time">
<text>{{memberLevel?memberLevel.endTime:''}}到期 </text>
<text>月度会员</text>
</view>
<view class="rule u-m-t-40 u-flex u-flex-between u-flex-y-center">
<text class="color-one ">
<text class="font-16">{{memberLevel? memberLevel.experience:''}}</text>
<text class="font-12">经验值</text>
</text>
<text class="desc">等级说明</text>
</view>
<view class="progress">
<view class="block" :style="{width:expProgress+'%'}"></view>
</view>
<view class="u-m-t-12 next-tips" v-if="expProgress<100&&nextName">
还差{{memberLevel?memberLevel.nextExperienceValue:''}}成长值可以升级到{{nextName}}</view>
</view>
<view class="rule u-m-t-40 u-flex u-flex-between u-flex-y-center">
<text class="color-one ">
<text class="font-16">11000</text>
<text class="font-12">经验值</text>
</text>
<text class="desc">等级说明</text>
</view>
<view class="progress">
<view class="block" :style="{width:100+'px'}"></view>
</view>
<view class="u-m-t-12 next-tips">还差5695成长值可以升级到黄金会员</view>
</view>
</view>
<view class="vip-quanyi">
@@ -31,18 +35,19 @@
<text class="color-2 font-14 font-700">会员权益</text>
<view class="u-flex">
<text class="color-666 u-m-r-4 font-12">会员说明</text>
<up-icon name="question-circle" size="12" @click="modelShow"></up-icon>
<up-icon name="question-circle" size="12" @click="modelShow('会员说明')"></up-icon>
</view>
</view>
<view class="u-m-t-32">
<view class="menus" :class="state.pay_types=='tiaojian'?'menus-tiaojian' :'menus-pays'">
<view class="menus" :class="state.openType=='CONDITION'?'menus-tiaojian' :'menus-pays'">
<view class="item " v-for="(item,index) in menus" :key="index">
<view class="u-flex u-flex-x-center u-m-t-4 u-flex-center">
<image :src="item.icon" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
<view class="font-14 color-333 text-center u-m-t-4 u-flex">
<view class="font-14 color-333 text-center u-m-t-4 u-flex u-flex-center">
<text class="no-wrap u-m-r-4">{{item.name}}</text>
<up-icon @click="modelShow" size="12" name="question-circle" color="#333" v-if="showQuestion(index)"></up-icon>
<up-icon @click="modelShow(item.name)" size="12" name="question-circle" color="#333"
v-if="showQuestion(index)"></up-icon>
</view>
<view class="font-12 color-666 text-center">{{item.desc}}</view>
</view>
@@ -53,19 +58,19 @@
<view class="u-p-l-30 u-p-r-30">
<view class="color-333 font-700 font-14">升级规则</view>
<view class="color-666 font-14 u-m-t-16">
每消费1元获得10成长值
每消费1元获得{{state.costReward||''}}成长值
</view>
<view class="color-666 font-14 u-m-t-16">
每消费1元获得10成长值
每消费1元获得{{state.rechargeReward||''}}成长值
</view>
</view>
<up-popup :show="model.show" mode="center" round="16rpx">
<up-popup :show="model.show" mode="center" round="16rpx" close-on-click-overlay @close="model.show=false">
<view class="model-box">
<view class="u-flex u-flex-between">
<text class="color-000 font-700 font-16">详情说明</text>
<text class="color-000 font-700 font-16">{{model.title}}</text>
<up-icon name="close-circle" color="#666" size="28rpx" @click="modelHide"></up-icon>
</view>
<view class="u-m-t-18 up-content">
@@ -78,36 +83,52 @@
</template>
<script setup>
import {
onLoad
} from '@dcloudio/uni-app'
import * as vipApi from '@/common/api/market/vip.js'
import {
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
import {
ref,
reactive,
computed
} from "vue"
const model =reactive({
show:false
})
function modelHide(){
model.show=false;
}
function modelShow(){
model.show=true;
}
const modelContent = ref(`
1、可适用门店全部门店<br>
2、可适用商品部分商品<br>
3、可使用类型堂食<br>
4、可用时间段全时段可用<br>
5、限量规则每人限领3张每日可最多使用3张<br>
6、同享规则与限时折扣同享、与会员价同享<br>
7、其它说明这里是后台配置内容
`)
const state = reactive({
pay_types: 'tiaojian'
const model = reactive({
show: false,
title: ''
})
const pay_menus = [{
function modelHide() {
model.show = false;
}
function modelShow(name) {
if (name == '消费送积分') {
model.title = '消费送积分'
modelContent.value = `每消耗1元赠送${memberLevel.value.costRewardPoints}积分`
}
if (name == '周期福利') {
model.title = '周期福利'
modelContent.value =
`${memberLevel.value.cycleUnit}赠送${memberLevel.value.cycleRewardPoints}积分,${memberLevel.value.cycleRewardCouponList.length}张优惠券`
}
if (name == '会员说明') {
model.title = '会员说明'
modelContent.value = state.remark
}
model.show = true;
}
const modelContent = ref(``)
const state = reactive({
openType: 'CONDITION'
})
let pay_menus = [{
name: '赠送成长值',
desc: '赠送10000成长值',
desc: '',
icon: '/user/static/Frame_220.png',
},
{
@@ -122,7 +143,7 @@
},
{
name: '会员折扣',
desc: '全店折扣98折',
desc: '',
icon: '/user/static/Frame_223.png'
},
{
@@ -137,14 +158,14 @@
}
]
const tiaojian_menus = [{
let tiaojian_menus = [{
name: '享会员价',
desc: '全店会员价',
icon: '/user/static/Frame_222.png'
},
{
name: '会员折扣',
desc: '全店折扣98折',
desc: '',
icon: '/user/static/Frame_223.png'
},
{
@@ -160,7 +181,7 @@
]
const menus = ref(tiaojian_menus)
const menus = ref([])
function showQuestion(index) {
const len = menus.value.length
@@ -169,9 +190,110 @@
}
return false
}
function back(){
function back() {
uni.navigateBack()
}
const option = reactive({
shopId: ''
})
const memberLevel = ref(null)
const shopInfo = reactive({})
const shopUserInfo = ref({})
const memberLevelList=ref([])
onLoad((opt) => {
Object.assign(option, opt)
console.log(option);
let shopId = option.shopId
init(shopId)
})
const expProgress = ref(0)
async function init(shopId) {
const userRes = await APIshopUserInfo({
shopId
})
if (userRes) {
shopUserInfo.value = userRes
}
const shopRes = await APIusershopInfodetail({
shopId
})
if (shopRes) {
Object.assign(shopInfo, shopRes.shopInfo)
}
const res = await vipApi.config({
shopId: shopId
})
if (res) {
Object.assign(state, res.memberConfig)
memberLevelList.value=res.memberLevelList
pay_menus = pay_menus.map(v => {
if (v.name == '优惠券') {
if(res.memberLevel.cycleRewardCouponList.length){
v.desc = `${res.memberLevel.cycleUnit}赠送${res.memberLevel.cycleRewardCouponList.length}张优惠券`
}else{
v.desc=''
}
}
if (v.name == '会员折扣') {
v.desc = '全店折扣'+res.memberLevel.discount+'折'
}
return v
})
tiaojian_menus=tiaojian_menus.map(v=>{
if (v.name == '优惠券') {
if(res.memberLevel.cycleRewardCouponList.length){
v.desc = `${res.memberLevel.cycleUnit}赠送${res.memberLevel.cycleRewardCouponList.length}张优惠券`
}else{
v.desc=''
}
}
if (v.name == '会员折扣') {
v.desc = '全店折扣'+res.memberLevel.discount+'折'
}
return v
})
if (res.memberConfig.openType == 'PAY') {
menus.value = pay_menus
} else {
menus.value = tiaojian_menus
}
}
const res1 = await vipApi.detail({
shopId: shopId
})
if (res1) {
memberLevel.value = {
...res1.memberLevel,
endTime: res1.endTime,
experience: res1.experience,
nextExperienceValue: res1.nextExperienceValue
}
const total = res1.experience * 1 + res1.nextExperienceValue * 1
const percent = (res1.experience * 1 / total) * 100
if (total <= 0 || res1.experience * 1 <= 0) {
expProgress.value = 100
}
expProgress.value = percent
}
}
const nextName=computed(()=>{
if(memberLevelList.value.length<=0||!memberLevel.value){
return null
}
const index=memberLevelList.value.find(v=>v.id==memberLevel.value.id)
if(index!=-1||index>=memberLevelList.value.length-1){
return null
}
const next=memberLevelList.value[index+1]
return next.name
})
</script>
@@ -203,7 +325,7 @@
}
.vip-box {
background-size: cover;
position: relative;
border-radius: 12px;

57
utils/pay.js Normal file
View File

@@ -0,0 +1,57 @@
export const pay = (res) => {
return new Promise((reslove, reject) => {
uni.showLoading({
title: '支付中...',
mask: true
})
uni.requestPayment({
// #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.appId, // 微信支付商户号
timeStamp: res.timeStamp, // 时间戳(单位:秒)
nonceStr: res.nonceStr, // 随机字符串
package: res.package, // 固定值
signType: res.signType, //固定值
paySign: res.paySign, //签名
// #endif
// #ifdef MP-ALIPAY
provider: 'alipay', //支付类型-固定值
orderInfo: res.tradeNo, // 微信支付商户号
// #endif
success: (res) => {
console.log('pay');
console.log(res);
uni.hideLoading()
// #ifdef MP-WEIXIN
uni.showToast({
title: "支付成功",
icon:'none'
})
console.log('支付成功')
resolve(res)
// #endif
// #ifdef MP-ALIPAY
if (res.resultCode == '9000') {
uni.showToast({
title: "支付成功",
icon:'none'
})
resolve(res)
} else {
uni.showToast({
title: "支付失败",
icon:'none'
})
}
// #endif
},
fail: (res) => {
setTimeout(() => {
uni.hideLoading()
}, 1000)
reject(false)
},
});
})
}