临时提交

This commit is contained in:
zpc 2025-03-23 03:55:07 +08:00
parent 7512cb366b
commit d7d879e71e
8 changed files with 2219 additions and 1847 deletions

11
App.vue
View File

@ -184,4 +184,13 @@ button.hide {
.uni-tabbar__icon {
height: 50px !important;
}
</style>
</style>
<template>
<view>
<!-- 主应用容器 -->
<view>
<slot></slot>
</view>
</view>
</template>

View File

@ -36,6 +36,7 @@ class ConfigManager {
if (res.status === 1 && res.data) {
configData = res.data;
console.log('全局配置数据加载成功');
uni.setStorageSync('configData', configData);
resolve(configData);
} else {
console.error('加载配置数据失败:', res.msg || '未知错误');

View File

@ -0,0 +1,240 @@
<template>
<uni-popup ref="popup" type="center" maskBackgroundColor="rgba(0,0,0,0.9)">
<view v-if="visible" class="preview-popup">
<!-- 商品图片 -->
<view class="pic center relative">
<image :src="innerImgUrl" lazy-load></image>
<view class="type-tag justify-center" v-if="innerTipTitle">{{ innerTipTitle }}</view>
</view>
<!-- 商品标题 -->
<view class="title">
<text class="hang1">{{ innerTitle }}</text>
</view>
<!-- 商品信息列表 -->
<view class="info-list">
<view class="info-item" v-if="innerProbability">{{ innerProbability }}</view>
<view class="info-item" v-if="innerProductType">产品类型: {{ innerProductType }}</view>
<view class="info-item" v-for="(item, index) in innerExtraInfo" :key="index">{{ item }}</view>
</view>
<!-- 关闭按钮 -->
<view class="close icon" @click="closePopup">
<image :src="$img('/static/img/close.png')" lazy-load></image>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
name: 'DetailPreviewPopup',
props: {
//
title: {
type: String,
default: ''
},
//
imgUrl: {
type: String,
default: ''
},
//
tipTitle: {
type: String,
default: ''
},
//
productType: {
type: String,
default: ''
},
//
probability: {
type: String,
default: ''
},
// ()
extraInfo: {
type: Array,
default: () => []
}
},
data() {
return {
visible: false,
//
innerTitle: '',
innerImgUrl: '',
innerTipTitle: '',
innerProductType: '',
innerProbability: '',
innerExtraInfo: []
}
},
watch: {
// props
title(val) {
this.innerTitle = val;
},
imgUrl(val) {
this.innerImgUrl = val;
},
tipTitle(val) {
this.innerTipTitle = val;
},
productType(val) {
this.innerProductType = val;
},
probability(val) {
this.innerProbability = val;
},
extraInfo(val) {
this.innerExtraInfo = val;
}
},
created() {
//
this.innerTitle = this.title;
this.innerImgUrl = this.imgUrl;
this.innerTipTitle = this.tipTitle;
this.innerProductType = this.productType;
this.innerProbability = this.probability;
this.innerExtraInfo = this.extraInfo;
},
methods: {
//
setPreviewData(data) {
if (!data) return;
//
if (data.title !== undefined) this.innerTitle = data.title;
if (data.imgUrl !== undefined) this.innerImgUrl = data.imgUrl;
if (data.tipTitle !== undefined) this.innerTipTitle = data.tipTitle;
if (data.productType !== undefined) this.innerProductType = data.productType;
if (data.probability !== undefined) this.innerProbability = data.probability;
if (data.extraInfo !== undefined) this.innerExtraInfo = data.extraInfo;
//
this.open();
},
//
open() {
console.log('尝试打开弹窗');
this.visible = true;
// 使nextTickDOM
this.$nextTick(() => {
console.log('DOM已更新准备打开弹窗');
if (this.$refs.popup) {
this.$refs.popup.open();
console.log('弹窗已打开');
} else {
console.error('popup ref不存在请检查组件是否正确挂载');
}
});
},
//
closePopup() {
this.visible = false;
if (this.$refs.popup) {
this.$refs.popup.close();
}
this.$emit('close');
}
}
}
</script>
<style lang="scss" scoped>
.preview-popup {
position: relative;
width: 570rpx;
box-sizing: border-box;
//
.pic {
width: 570rpx;
height: 598rpx;
background: #FFFFFF;
border-radius: 16rpx;
image {
width: 548rpx;
height: 549rpx;
}
//
.type-tag {
width: 68rpx;
height: 32rpx;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 12rpx;
left: 24rpx;
font-weight: 400;
font-size: 14rpx;
color: #FFFFFF;
box-sizing: border-box;
background: url($imgurl + 'common/chouLabel.png') no-repeat 0 0 / 100% 100%;
}
}
//
.title {
margin: 40rpx auto 0;
width: 564rpx;
height: 60rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx;
border-radius: 12rpx;
background: #F5F5F5;
text {
font-weight: 600;
font-size: 24rpx;
color: #333333;
}
}
//
.info-list {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
padding: 20rpx 0 0;
.info-item {
margin-top: 14rpx;
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
//
.close {
width: 48rpx;
height: 48rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%, 160%);
image {
width: 100%;
height: 100%;
}
}
}
</style>

View File

@ -0,0 +1,233 @@
<template>
<view class="prize-log-wrapper">
<!-- 分类标签 -->
<scroll-view class="sub-tab" scroll-x>
<view
v-for="(item, i) in subTab"
:key="i"
class="sub-tab-item"
:class="{ act: currentSubTab === i, unact: currentSubTab !== i }"
@click="onSubTabChange(i)"
>
{{ item.shang_title }}
</view>
</scroll-view>
<!-- 中奖记录列表 -->
<view v-if="logList.length > 0" class="log-list">
<view v-for="(item, i) in logList" :key="i" class="log-item br20">
<!-- 用户头像 -->
<view class="avatar">
<image :src="item.user_info.headimg" lazy-load></image>
</view>
<!-- 用户信息 -->
<view class="info">
<view class="name hang1">{{ item.user_info.nickname }}</view>
<view class="time">{{ item.addtime }}</view>
</view>
<!-- 中奖信息 -->
<view class="prize">
<view class="pic flex">
<image
class="img100"
:src="item.goodslist_imgurl"
lazy-load
></image>
</view>
<view class="column align-end">
<view
class="prize-shang center"
:style="{ background: item.shang_color }"
>
{{ item.shang_title }}
</view>
<view class="flex mt10">
<view class="title hang1">{{ item.goodslist_title }}</view>
<view class="num">×{{ item.prize_num }}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 无数据提示 -->
<view v-else class="empty-tip">暂无中奖记录</view>
</view>
</template>
<script>
export default {
name: "DetailPrizeLog",
props: {
//
subTab: {
type: Array,
default: () => [],
},
//
logList: {
type: Array,
default: () => [],
},
//
currentSubTab: {
type: Number,
default: 0,
},
},
methods: {
//
onSubTabChange(index) {
if (index === this.currentSubTab) return;
this.$emit("sub-tab-change", index);
},
},
};
</script>
<style lang="scss" scoped>
.prize-log-wrapper {
width: 100%;
//
.sub-tab {
white-space: nowrap;
padding: 30rpx 0 10rpx;
.sub-tab-item {
display: inline-flex;
align-items: center;
padding: 0 20rpx;
height: 50rpx;
margin-left: 30rpx;
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
border-radius: 8rpx;
transition: all 0.2s;
//
&.act {
color: #333333;
background: #e6f791;
}
//
&.unact {
color: #333333;
background: #f5f5f5;
}
&:last-child {
margin-right: 30rpx;
}
}
}
//
.log-list {
padding: 1rpx 30rpx 30rpx;
.log-item {
height: 144rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
margin-top: 20rpx;
background: #f8f8f8;
//
.avatar {
width: 76rpx;
height: 76rpx;
background: #9d9d9d;
border: 1px solid #cccccc;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
//
.info {
width: 230rpx;
margin-left: 20rpx;
.name {
font-size: 20rpx;
font-weight: 400;
color: #333333;
}
.time {
margin-top: 10rpx;
white-space: nowrap;
font-size: 16rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
}
}
//
.prize {
flex: 1;
padding-left: 60rpx;
display: flex;
align-items: center;
.prize-shang {
height: 40rpx;
padding: 0 20rpx;
border-radius: 8rpx;
border: 2rpx solid #ffffff;
font-weight: 400;
font-size: 24rpx;
color: #ffffff;
}
.pic {
width: 76rpx;
height: 76rpx;
image {
width: 100%;
height: 100%;
}
}
.title {
width: 100rpx;
margin-left: 20rpx;
font-size: 16rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
text-align: right;
}
.num {
font-size: 16rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
}
}
}
}
//
.empty-tip {
text-align: center;
padding: 40rpx 0;
color: #999;
font-size: 28rpx;
}
}
</style>

View File

@ -0,0 +1,90 @@
<template>
<view class="detail-toolbar" :style="customStyle">
<!-- 购买说明按钮 -->
<view class="toolbar-item">
<image class="toolbar-img"
:src="$img1('common/gzsm.png')"
@click="onRuleClick(getRuleId)">
</image>
</view>
<!-- 商品预览按钮 -->
<view class="toolbar-item" @tap="onTabChange(1)">
<image class="toolbar-img" :src="$img1(currentTab==1 ? 'common/spyl1.png' : 'common/spyl2.png')"></image>
</view>
<!-- 中赏记录按钮 -->
<view class="toolbar-item" @tap="onTabChange(2)">
<image class="toolbar-img" :src="$img1(currentTab==1 ? 'common/zsjl2.png' : 'common/zsjl1.png')"></image>
</view>
<!-- 换箱按钮 -->
<view class="toolbar-item" @click="onChangeBox">
<image class="toolbar-img" :src="$img1('common/huanxiang.png')"></image>
</view>
</view>
</template>
<script>
export default {
name: 'DetailToolbar',
props: {
goodsType: {
type: [Number, String],
default: 0
},
currentTab: {
type: [Number, String],
default: 1
},
customStyle: {
type: String,
default: ''
}
},
computed: {
getRuleId() {
// ID
const typeRuleMap = {
5: 13,
6: 18
};
return typeRuleMap[this.goodsType] || 7;
}
},
methods: {
onRuleClick(ruleId) {
this.$emit('rule-click', ruleId, '购买说明');
},
onTabChange(tabId) {
this.$emit('tab-change', tabId);
},
onChangeBox() {
this.$emit('change-box');
}
}
}
</script>
<style lang="scss">
.detail-toolbar {
display: flex;
flex-direction: row;
margin-left: 32rpx;
margin-top: 56rpx;
.toolbar-item {
width: 160rpx;
height: 92rpx;
&:not(:first-child) {
margin-left: 16rpx;
}
.toolbar-img {
width: 160rpx;
height: 92rpx;
}
}
}
</style>

View File

@ -7,6 +7,10 @@ import ConfigManager from '@/common/config.js'
import RequestManager from '@/common/request.js'
import EnvConfig from '@/common/env.js'
// 全局注册uni-popup组件
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
Vue.component('uni-popup', uniPopup)
// 全局变量配置
Vue.prototype.siteBaseUrl = EnvConfig.apiBaseUrl
Vue.prototype.$baseUrl = EnvConfig.baseUrl

View File

@ -1,7 +1,10 @@
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue",
"^collect-btn$": "@/components/collect-btn/collect-btn.vue"
"^collect-btn$": "@/components/collect-btn/collect-btn.vue",
"^detail-toolbar$": "@/components/detail-toolbar/detail-toolbar.vue",
"^detail-prize-log$": "@/components/detail-prize-log/detail-prize-log.vue",
"^detail-preview-popup$": "@/components/detail-preview-popup/detail-preview-popup.vue"
},
"pages": [{
"path": "pages/shouye/index",

File diff suppressed because it is too large Load Diff