第一次上传
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"name" : "科讯代购",
|
||||
"appid" : "__UNI__06C2D6A",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.8",
|
||||
"versionCode" : 108,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : false,
|
||||
"waiting" : false,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"Barcode" : {},
|
||||
"Maps" : {},
|
||||
"Geolocation" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
],
|
||||
"minSdkVersion" : 25,
|
||||
"targetSdkVersion" : 25,
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"idfa" : false,
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"ad" : {},
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"name" : "amapZAvZjTHj",
|
||||
"appkey_ios" : "3caf9e6f01b0085be1e75e0d0e281fe7",
|
||||
"appkey_android" : "3caf9e6f01b0085be1e75e0d0e281fe7"
|
||||
}
|
||||
},
|
||||
"geolocation" : {
|
||||
"amap" : {
|
||||
"name" : "amapZAvZjTHj",
|
||||
"__platform__" : [ "android" ],
|
||||
"appkey_ios" : "",
|
||||
"appkey_android" : "3caf9e6f01b0085be1e75e0d0e281fe7"
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx48366fb1ba81d1ea",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "获取用户地址展示附近商家"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": ["getLocation"]
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"h5" : {
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : "7DIBZ-K4HCJ-ZR2FE-FOOOP-SALFT-RLFYW"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,481 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
|
||||
|
||||
<!-- 商品图片展示 -->
|
||||
<view class="product-image-section">
|
||||
<image :src="Service.GetMateUrlByImg(goodsInfo.img)" mode="aspectFill" class="product-image">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<view class="product-info-section">
|
||||
<text class="product-name">{{goodsInfo.name}}</text>
|
||||
<text class="product-price">¥{{goodsInfo.price}}</text>
|
||||
<text class="product-description">{{goodsInfo.brief}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 商家信息卡片 -->
|
||||
<view class="shop-card-section">
|
||||
<view class="shop-header">
|
||||
<text class="shop-name">{{merchInfo.name}}</text>
|
||||
<view class="shop-tags">
|
||||
<view class="tag" style="background-color: #FF9500;">{{merchInfo.code=='Discounts'?'积分可用':'积分不可用'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop-info">
|
||||
<view class="info-item">
|
||||
<u-icon name="map" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">{{merchInfo.address}}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<u-icon name="phone" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">{{merchInfo.phone}}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<u-icon name="map" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">{{merchInfo.time}}</text>
|
||||
</view>
|
||||
<!-- <view class="info-item">
|
||||
<u-icon name="home" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">朝阳美食社区</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 同店推荐 -->
|
||||
<view v-if="recommendations.length>0" class="recommendations-section">
|
||||
<text class="section-title">同店推荐</text>
|
||||
<view class="recommendations-list">
|
||||
<view @click="Service.GoPage('/pages/goods/goodsDetail')" class="recommendation-item"
|
||||
v-for="(item, index) in recommendations" :key="index">
|
||||
<image :src="Service.GetMateUrlByImg(item.img)" mode="aspectFill" class="recommendation-image">
|
||||
</image>
|
||||
<view class="recommendation-info">
|
||||
<text class="recommendation-name">{{ item.name }}</text>
|
||||
<text class="recommendation-price">{{ item.price }}</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="28rpx" color="#999999" class="arrow-icon"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore v-if="recommendations.length>0" :status="status" />
|
||||
<view class="" style="width: 100%; height: 150rpx;">
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="action-buttons">
|
||||
<u-button type="primary" @click="handleContactShop()" :custom-style="contactButtonStyle">联系商家</u-button>
|
||||
<u-button type="primary" @click="handleViewLocation()" :custom-style="locationButtonStyle">查看位置</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Service } from "@/Service/Service"
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { vpMerchService } from '@/Service/vp/vpMerchService'
|
||||
|
||||
// 商品信息
|
||||
interface Goods {
|
||||
brief : string
|
||||
img : string
|
||||
name : string
|
||||
price : number
|
||||
}
|
||||
|
||||
// 商家数据类型
|
||||
interface shop {
|
||||
showImg : string
|
||||
price : number
|
||||
name : string
|
||||
score : number
|
||||
tag : string
|
||||
merchId : string
|
||||
address : string
|
||||
phone : string
|
||||
sale : number
|
||||
lat : string
|
||||
lon : string
|
||||
time : string
|
||||
code:string
|
||||
}
|
||||
|
||||
|
||||
let merchInfo = ref<shop>({
|
||||
showImg: '',
|
||||
price: 0,
|
||||
name: '',
|
||||
score: 0,
|
||||
tag: '',
|
||||
merchId: '',
|
||||
address: '',
|
||||
phone: '',
|
||||
sale: 0,
|
||||
lat: '',
|
||||
lon: '',
|
||||
time: '',
|
||||
code:''
|
||||
})
|
||||
|
||||
// 营业时间处理
|
||||
let weekList = ref<Array<number>>([])
|
||||
let openTime = ref()
|
||||
let closeTime = ref()
|
||||
let timefunc = ref(-1)
|
||||
|
||||
// 推荐商品数据类型
|
||||
interface Recommendation {
|
||||
goodsId : string;
|
||||
name : string;
|
||||
price : string;
|
||||
img : string;
|
||||
}
|
||||
|
||||
let goodsId = ref()
|
||||
let status = ref()
|
||||
let page = ref(0)
|
||||
|
||||
let goodsInfo = ref<Goods>({
|
||||
brief: '',
|
||||
img: '',
|
||||
name: '',
|
||||
price: 0
|
||||
})
|
||||
|
||||
|
||||
// 同店推荐商品数据
|
||||
const recommendations = ref<Recommendation[]>([]);
|
||||
|
||||
// 联系商家按钮样式
|
||||
const contactButtonStyle = ref({
|
||||
backgroundColor: '#FF6600',
|
||||
borderColor: '#FF6600',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '75rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginRight: '20rpx'
|
||||
});
|
||||
|
||||
// 查看位置按钮样式
|
||||
const locationButtonStyle = ref({
|
||||
backgroundColor: '#FF6600',
|
||||
borderColor: '#FF6600',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '75rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginLeft: '20rpx'
|
||||
});
|
||||
|
||||
|
||||
onLoad((data : any) => {
|
||||
goodsId.value = data.goodsId
|
||||
getData()
|
||||
})
|
||||
|
||||
|
||||
const getData = () => {
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
recommendations.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
if (status.value !== 'loadmore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
|
||||
vpMerchService.GetGoodsInfo(goodsId.value, page.value).then(res => {
|
||||
goodsInfo.value = res.data.goodsInfo
|
||||
merchInfo.value = res.data.merchInfo
|
||||
merchInfo.value.time = !res.data.merchInfo.busTime ? '' : timeCancle(res.data.merchInfo.busTime)
|
||||
recommendations.value = res.data.merchGoods
|
||||
let index = recommendations.value.findIndex((item) => {
|
||||
return item.goodsId == goodsId.value
|
||||
})
|
||||
recommendations.value.splice(index, 1)
|
||||
status.value = res.data.merchGoods.length == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 处理联系商家
|
||||
const handleContactShop = () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: merchInfo.value.phone, // 要拨打的电话号码
|
||||
success: function () {
|
||||
console.log('拨打电话成功');
|
||||
},
|
||||
fail: function (err) {
|
||||
console.error('拨打电话失败', err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 处理查看位置
|
||||
const handleViewLocation = () => {
|
||||
wx.openLocation({
|
||||
latitude: Number(merchInfo.value.lat),
|
||||
longitude: Number(merchInfo.value.lon),
|
||||
name: merchInfo.value.name,
|
||||
address: merchInfo.value.address,
|
||||
success: function (e) {
|
||||
console.log(e);
|
||||
},
|
||||
fail: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// 营业时间处理
|
||||
const timeCancle = (busTime : string) => {
|
||||
let data = busTime.split('_')
|
||||
openTime.value = data[1].split('-')[0]
|
||||
closeTime.value = data[1].split('-')[1]
|
||||
let timeData = data[0].split('-')
|
||||
for (let i = 0; i < timeData.length; i++) {
|
||||
if (timeData[i] == '0') {
|
||||
timeData[i] = '7'
|
||||
}
|
||||
}
|
||||
let time = ''
|
||||
timeData.sort((a : any, b : any) => {
|
||||
return a - b
|
||||
})
|
||||
timeData.map((item : any) => {
|
||||
weekList.value.push(item == '7' ? (Number(6)) : Number(item - 1))
|
||||
})
|
||||
let timeIndex = weekList.value[0] - 0
|
||||
let judgment = weekList.value.findIndex((item, index) => {
|
||||
return item - index !== timeIndex
|
||||
})
|
||||
|
||||
// 1是至 /0是全显示
|
||||
if (judgment == -1) {
|
||||
timefunc.value = 1
|
||||
} else {
|
||||
timefunc.value = 0
|
||||
}
|
||||
|
||||
if (timefunc.value == 0) {
|
||||
weekList.value.map((item) => {
|
||||
time = time + '周' + chinese(item) + ' '
|
||||
})
|
||||
} else {
|
||||
time = '周' + chinese((weekList.value[0])) + '至' + '周' + chinese((weekList.value[weekList.value.length - 1]))
|
||||
}
|
||||
|
||||
time = time + ' ' + data[1]
|
||||
|
||||
return time
|
||||
}
|
||||
|
||||
const chinese = (item : number) => {
|
||||
if (item + 1 == 1) {
|
||||
return '一'
|
||||
}
|
||||
if (item + 1 == 2) {
|
||||
return '二'
|
||||
} if (item + 1 == 3) {
|
||||
return '三'
|
||||
} if (item + 1 == 4) {
|
||||
return '四'
|
||||
} if (item + 1 == 5) {
|
||||
return '五'
|
||||
} if (item + 1 == 6) {
|
||||
return '六'
|
||||
} if (item + 1 == 7) {
|
||||
return '日'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 商品图片展示 */
|
||||
.product-image-section {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 商品信息 */
|
||||
.product-info-section {
|
||||
padding: 30rpx;
|
||||
margin: 30rpx;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
font-size: 40rpx;
|
||||
color: #FF6600;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-description {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
/* 商家信息卡片 */
|
||||
.shop-card-section {
|
||||
padding: 30rpx;
|
||||
margin: 30rpx;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.shop-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.shop-tags {
|
||||
display: flex;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.tag.new-shop {
|
||||
background-color: #4CD964;
|
||||
}
|
||||
|
||||
.tag.popular {
|
||||
background-color: #FF9500;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.info-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-icon {
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
font-size: 28rpx;
|
||||
margin-left: 15rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
/* 同店推荐 */
|
||||
.recommendations-section {
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.recommendations-list {
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.recommendation-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx 0;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.recommendation-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.recommendation-image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.recommendation-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.recommendation-name {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.recommendation-price {
|
||||
font-size: 30rpx;
|
||||
color: #FF6600;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
/* 底部操作按钮 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
padding: 30rpx 30rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,385 @@
|
||||
<template>
|
||||
<view class="point-records-page">
|
||||
<!-- 沉浸式状态栏 -->
|
||||
<view class="status-bar"></view>
|
||||
|
||||
<!-- 顶部导航 -->
|
||||
<view class="nav-bar">
|
||||
<image class="back-icon" src="/static/icons/back.svg" @click="Service.GoPageBack()" mode="aspectFit" />
|
||||
<text class="nav-title">余额明细</text>
|
||||
<view class="nav-placeholder"></view>
|
||||
</view>
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<view class="content">
|
||||
<!-- 当前积分区域 -->
|
||||
<view class="points-detail-section" style="margin-bottom: 20rpx;">
|
||||
<view class="" style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="" style="font-size: 30rpx; color: #999;">
|
||||
余额
|
||||
</view>
|
||||
<view class="" style="color: red; font-weight: bold; font-size: 34rpx; ">
|
||||
{{ integral }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="margin-top: 20rpx;">
|
||||
<u-button @click="Service.GoPage('/pages/userFunc/withdrow')"
|
||||
:custom-style="contactButtonStyle">立即提现</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 筛选标签 -->
|
||||
<view class="filter-tabs">
|
||||
<view v-for="(tab, index) in filterTabs" :key="index" class="filter-tab"
|
||||
:class="{ active: currentFilter === tab }" @click="currentFilter = tab;getUseraccInfo()">
|
||||
{{ tab }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分记录列表 -->
|
||||
<view class="records-list">
|
||||
<view v-for="(record, index) in pointsList" :key="index" class="record-item">
|
||||
<view class="record-info">
|
||||
<view class="record-header">
|
||||
<text class="record-title">{{ record.name }}</text>
|
||||
<text class="record-amount"
|
||||
:class="record.code=='收入'?'earn':'spend'">{{record.code=='收入'?'+':'-'}}{{ record.amount }}</text>
|
||||
</view>
|
||||
<text class="record-desc">{{ record.remark }}</text>
|
||||
<text class="record-time">{{ record.addTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="pointsList.length === 0" class="empty-state">
|
||||
<text class="ri-leaf-line empty-icon"></text>
|
||||
<text class="empty-text">暂无积分记录</text>
|
||||
</view>
|
||||
<up-loadmore v-else :status="status" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { vpUserService } from '@/Service/vp/vpUserService'
|
||||
import { Service, vpMerchService } from '@/Service/vp/vpMerchService'
|
||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||
// 积分明细数据类型
|
||||
interface PointsItem {
|
||||
amount : number
|
||||
code : string
|
||||
name : string
|
||||
addTime : string
|
||||
remark:string
|
||||
}
|
||||
|
||||
// 按钮样式
|
||||
const contactButtonStyle = ref({
|
||||
background: 'linear-gradient(135deg, #FF6B00, #FF9500)',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '85rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginRight: '20rpx'
|
||||
});
|
||||
|
||||
let integral = ref(0)
|
||||
let status = ref('loadmore')
|
||||
let page = ref(1)
|
||||
// 积分明细数据
|
||||
const pointsList = ref<PointsItem[]>([
|
||||
|
||||
]);
|
||||
|
||||
|
||||
const filterTabs = [ '全部','支出','收入']
|
||||
|
||||
const currentFilter = ref('全部')
|
||||
|
||||
|
||||
onLoad(() => {
|
||||
getUseraccInfo()
|
||||
})
|
||||
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
|
||||
|
||||
const getUseraccInfo = () => {
|
||||
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
pointsList.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
const getList = () => {
|
||||
|
||||
if (status.value !== 'loadmore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
vpMerchService.GetMerchAccInfo(currentFilter.value=='全部'?'':currentFilter.value , page.value).then(res => {
|
||||
integral.value = res.data.merchAcc.integral
|
||||
pointsList.value = [...pointsList.value, ...res.data.merchAccLog]
|
||||
status.value = res.data.merchAccLog.length == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.point-records-page {
|
||||
min-height: 100vh;
|
||||
background: #F5F5F5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
/* 积分明细 */
|
||||
.points-detail-section {
|
||||
background-color: #ffffff;
|
||||
padding: 40rpx 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
/* 状态栏 */
|
||||
.status-bar {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 导航栏 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 60rpx 24rpx 20rpx 24rpx;
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
padding: 8rpx;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.nav-placeholder {
|
||||
width: 48rpx;
|
||||
}
|
||||
|
||||
/* 内容区域 */
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
/* 积分统计区域 */
|
||||
.stats-section {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
font-size: 48rpx;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.stat-icon.earn {
|
||||
color: #10B981;
|
||||
}
|
||||
|
||||
.stat-icon.spend {
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: #222222;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
background: rgba(0, 0, 0, 0.08);
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
/* 筛选标签 */
|
||||
.filter-tabs {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 8rpx;
|
||||
margin-bottom: 24rpx;
|
||||
display: flex;
|
||||
gap: 8rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.filter-tab {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
border-radius: 12rpx;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
color: #FFFFFF;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 记录列表 */
|
||||
.records-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.record-item {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.record-icon-box {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.record-icon-box.earn {
|
||||
background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
|
||||
}
|
||||
|
||||
.record-icon-box.earn text {
|
||||
font-size: 36rpx;
|
||||
color: #10B981;
|
||||
}
|
||||
|
||||
.record-icon-box.spend {
|
||||
background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
|
||||
}
|
||||
|
||||
.record-icon-box.spend text {
|
||||
font-size: 36rpx;
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
.record-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.record-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.record-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.record-amount {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #10B981;
|
||||
}
|
||||
|
||||
.record-amount.spend {
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
.record-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.record-time {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty-state {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 80rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user