1、分享的图片二维码:上传时的错路径判断

2、发布的静态页面
3、分类的底部导航栏取消
4、积分的任务跳转页面
5、积分商城:数据接口对接
This commit is contained in:
wangzimeng 2025-07-28 17:38:58 +08:00
parent 3564721d23
commit c621ff0ff4
6 changed files with 1721 additions and 296 deletions

View File

@ -6,7 +6,7 @@
<view class="conTop">
<view class="textLine">
<view class="fs30 bold c3" style="line-height: 26rpx;">当前积分</view>
<view class="fs60 bold c3" style="margin-top: 30rpx;line-height: 60rpx;">6963</view>
<view class="fs60 bold c3" style="margin-top: 30rpx;line-height: 60rpx;">{{score}}</view>
<view class="scoreDetail" @click="toPage('/pages/user/wallet/score')">
<view class="fs28 c9">积分明细</view>
<image style="width: 28rpx;height: 28rpx;margin-left: 10rpx;"
@ -16,60 +16,67 @@
</view>
<!-- tabs页签 -->
<view class="tabs-box">
<su-tabs
:list="tabMaps"
@change="onChange"
:scrollable="false"
:current="currentTab"
></su-tabs>
<su-tabs :list="tabMaps" @change="onChange" :scrollable="false" :current="currentTab"></su-tabs>
</view>
<!-- 可兑换券列表 -->
<view class="exChangeBox">
<view class="exChangeBox" v-if="currentTab == 0">
<view class="couponsList">
<view class="list-item">
<image style="width: 330rpx;height: 200rpx;" src="https://jiangxiaoxian.0rui.cn/fullCoupon.png"></image>
<view class="list-item" v-for="(item, index) in couponList" :key="index" @click="openCouponPro(item)">
<image style="width: 330rpx;height: 200rpx;" src="https://jiangxiaoxian.0rui.cn/fullCoupon.png">
</image>
<view class="item-text">
<view class="fs30 c3" style="margin: 0 auto;">优惠券满100减50</view>
<view class="fs30 c3" style="margin: 0 auto;text-align: center;">{{item.name}}</view>
<view class="exchangeBtn">
100积分兑换
{{item.score}}积分兑换
</view>
</view>
</view>
</view>
</view>
<view class="list-item">
<image style="width: 330rpx;height: 200rpx;" src="https://jiangxiaoxian.0rui.cn/fullCoupon.png"></image>
<!-- 次数券 -->
<view class="exChangeBox" v-if="currentTab == 1">
<view class="couponsList">
<view class="list-item" v-for="(item, index) in couponList" :key="index" @click="openCouponPro(item)">
<image style="width: 330rpx;height: 200rpx;"
src="https://jiangxiaoxian.0rui.cn/scoreNumCoupon.png"></image>
<view class="item-text">
<view class="fs30 c3" style="margin: 0 auto;">优惠券满100减50</view>
<view class="fs30 c3" style="margin: 0 auto;text-align: center;">{{ item.name }}</view>
<view class="exchangeBtn">
100积分兑换
</view>
</view>
</view>
<view class="list-item">
<image style="width: 330rpx;height: 200rpx;" src="https://jiangxiaoxian.0rui.cn/fullCoupon.png"></image>
<view class="item-text">
<view class="fs30 c3" style="margin: 0 auto;">优惠券满100减50</view>
<view class="exchangeBtn">
100积分兑换
{{item.score}}积分兑换
</view>
</view>
</view>
</view>
</view>
<!-- 无数据展示
<!-- 无数据展示 -->
<view class="flex flex-column flex-start align-items"
v-if="feetHisList.length == 0" style="margin-top: 300rpx;">
v-if="couponList.length == 0" style="margin-top: 300rpx;">
<image src="https://jiangxiaoxian.0rui.cn/noneList.png" mode="" style="width: 180rpx;height: 180rpx;">
</image>
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">暂无数据信息</view>
</view>-->
</view>
<su-popup :show="showCouponPro == true" type="center" round="10" :isMaskClick="false">
<view class="popupContacted">
<view class="contactedBox">
<image style="width: 198rpx;height: 122rpx;position: relative;left: 12rpx;" src="https://jiangxiaoxian.0rui.cn/couponSuccess.png"></image>
<view style="font-size: 36rpx;line-height: 50rpx;font-weight: 900;color: #3d3d3d;text-align: center;">是否兑换</view>
<view style="font-size: 30rpx;line-height: 44rpx;font-weight: 400;color: #3d3d3d;text-align: center;">{{couponName}}</view>
</view>
<view class="contactBtn">
<view class="tactBtnBox" style="color: #999999;" @click="showCouponPro = false">取消</view>
<view class="tactBtnBox2" style="color: #333333;" @click="handleCouponSure">确定</view>
</view>
</view>
</su-popup>
</view>
</s-layout>
@ -88,23 +95,30 @@
} from 'vue';
import _ from 'lodash';
const tabMaps = [
{
const listQuery = ref({
page: 1,
limit: 10,
list_rows: 10,
status: 1,
})
const tabMaps = [{
name: '优惠券',
value: '0',
value: '1',
},
{
name: '次数券',
value: '1',
value: '2',
},
];
const currentTab = ref(0)
const score = ref(0)
//tabs
function onChange(e) {
console.log('onChange',e);
console.log('onChange', e);
currentTab.value = e.index
console.log('切换tabs',currentTab.value);
// getLogList();
console.log('切换tabs', currentTab.value);
listQuery.value.status = e.value
getCouponList();
}
//
@ -115,12 +129,61 @@
}
//
const couponList = ref([])
const couponCount = ref(0)
async function getCouponList() {
const res = await sheep.$api.app.scoreShop.fullList({
page: listQuery.value.page,
limit: listQuery.value.limit,
status: listQuery.value.status,
order: 'normal'
});
if (res.code === 1) {
couponList.value = res.data.list;
couponCount.value = res.data.count;
score.value = res.data.score
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}
const showCouponPro = ref(false)
const couponName = ref('')
const couponSelectId = ref('')
function openCouponPro(item) {
showCouponPro.value = true;
couponName.value = item.name;
couponSelectId.value = item.id
}
async function handleCouponSure() {
const res = await sheep.$api.app.scoreShop.exCoupon({
id: couponSelectId.value
});
if (res.code === 1) {
uni.showToast({
title: res.msg,
icon: 'success'
})
showCouponPro.value = false;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
})
showCouponPro.value = false;
}
}
//
onReachBottom(() => {
// loadmore();
});
onLoad(() => {
// getData();
getCouponList();
});
</script>
@ -151,6 +214,7 @@
.container {
background-color: #ffffff;
height: 100vh;
.conTop {
width: 100%;
@ -176,12 +240,14 @@
.exChangeBox {
background-color: #ffffff;
width: 690rpx;
margin-top: 30rpx;
.couponsList {
width: 100%;
padding: 0 30rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);;
grid-template-columns: repeat(2, 1fr);
;
grid-gap: 20px;
// display: flex;
// justify-content: center;
@ -200,6 +266,7 @@
background-color: #fcc74e;
height: 70rpx;
width: 270rpx;
margin-top: 30rpx;
border-radius: 223rpx;
align-items: center;
justify-content: center;
@ -215,5 +282,51 @@
}
.popupContacted {
width: 660rpx;
height: 477rpx;
background-color: #fff;
display: grid;
border-radius: 18rpx;
.contactedBox {
width: 660rpx;
height: 325rpx;
padding: 30rpx 0;
// margin-top: 40rpx;
display: grid;
justify-content: center;
align-items: center;
}
.contactBtn {
width: 660rpx;
height: 92rpx;
border-top: 1rpx solid #eeeeee;
display: flex;
border-radius: 0 0 18rpx 18rpx;
// margin-top: 40rpx;
.tactBtnBox {
width: 330rpx;
height: 92rpx;
border-right: 1rpx solid #eeeeee;
display: flex;
align-items: center;
justify-content: center;
}
.tactBtnBox2 {
width: 330rpx;
height: 92rpx;
// border-right: 1rpx solid #eeeeee;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
</style>

View File

@ -84,7 +84,7 @@
</view>
</view>
<view class="signBtn">
<view class="signBtn" @click="toTabb('/pages/index/fabu')">
去发布
</view>
</view>
@ -125,7 +125,7 @@
</view>
</view>
<view class="signBtn">
<view class="signBtn" @click="toPage('/pages/index/category')">
去消费
</view>
</view>
@ -143,7 +143,7 @@
</view>
</view>
<view class="signBtn">
<view class="signBtn" @click="showShare">
去分享
</view>
</view>
@ -218,6 +218,7 @@
computed,
reactive
} from 'vue';
import { showShareModal } from '@/sheep/hooks/useModal';
const headerBg = sheep.$url.css('/assets/addons/shopro/uniapp/app/sign.png');
@ -381,6 +382,30 @@
url: e
})
}
//tabbars
const toTabb = (e) => {
uni.switchTab({
url: e
})
}
//
function showShare() {
// 使URL
const shareInfo = {
title: '每日签到领积分',
desc: '快来签到领取积分奖励吧',
image: 'https://jiangxiaoxian.0rui.cn/valid-image.png', // URL
params: {
page: 'sign'
}
};
//
showShareModal(shareInfo);
}
</script>
<style lang="scss" scoped>

View File

@ -1,5 +1,6 @@
<template>
<s-layout title="分类" tabbar="/pages/index/category" :bgStyle="{ color: '#fff' }">
<!-- tabbar="/pages/index/category" -->
<s-layout title="分类" :bgStyle="{ color: '#fff' }">
<view class="s-category">
<view class="three-level-wrap ss-flex ss-col-top">
<view class="side-menu-wrap" :style="[{ top: Number(statusBarHeight + 88) + 'rpx' }]">

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
import request from '@/sheep/request';
import { baseUrl } from '@/sheep/config';
import {
baseUrl
} from '@/sheep/config';
export default {
// 系统初始化
@ -56,6 +58,18 @@ export default {
}),
//积分商城
scoreShop: {
fullList: (params) =>
request({
url: 'meal.score/product_list',
method: 'GET',
params,
}),
exCoupon: (data) =>
request({
url: 'meal.score/exchange',
method: 'POST',
data,
}),
list: (params) =>
request({
url: 'app.score_shop',

View File

@ -67,12 +67,18 @@ export const get_files_and_is_max = (res, _extname) => {
*/
export const get_file_info = (filepath) => {
return new Promise((resolve, reject) => {
if (!filepath) {
reject(new Error('Invalid file path'));
return;
}
uni.getImageInfo({
src: filepath,
success(res) {
resolve(res);
},
fail(err) {
console.error('Failed to get image info:', err);
reject(err);
},
});
@ -97,6 +103,8 @@ export const get_file_data = async (files, type = 'image') => {
path: files.path,
video: {},
};
try {
if (type === 'image') {
const imageinfo = await get_file_info(files.path);
delete filedata.video;
@ -106,5 +114,11 @@ export const get_file_data = async (files, type = 'image') => {
} else {
delete filedata.image;
}
} catch (error) {
console.error('Error processing file data:', error);
// 返回基本文件数据,即使图片信息获取失败
delete filedata.image;
delete filedata.video;
}
return filedata;
};