init
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<s-pages title="钱包">
|
||||
<!-- 头部 -->
|
||||
<view class="header" :style="{ backgroundImage: 'url(' + $url + 'home/wallet2.png' + ')' }">
|
||||
<view class="header-content">
|
||||
<view class="title" @click="jumpPage('充值', '/pages/home/recharge')">
|
||||
钱包余额 <uni-icons type="right" color="#fff" size="28rpx" />
|
||||
</view>
|
||||
<view class="num size68 m-y-8" @click="jumpPage('充值', '/pages/home/recharge')">
|
||||
{{ $fen2yuan(money_obj?.balance || 0) }}
|
||||
</view>
|
||||
<view class="line" />
|
||||
<view class="flex m-t-22">
|
||||
<view class="title"> 可提现金额 </view>
|
||||
<view class="num m-l-34" @click="jumpPage('提现', '/pages/home/pay/withdraw')">
|
||||
{{ $fen2yuan(money_obj?.withdrawAmount || 0) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<view class="list-content">
|
||||
<view class="title-left" />
|
||||
<view class="title"> 好物推荐 </view>
|
||||
<view class="title-right" />
|
||||
</view>
|
||||
<!-- 商品 -->
|
||||
<su-sticky top="100rpx">
|
||||
<view class="goodsIndex">
|
||||
<goods :list="tagList" v-if="tagList?.length"></goods>
|
||||
</view>
|
||||
</su-sticky>
|
||||
</s-pages>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import * as api from '@/sheep/api/home/pay';
|
||||
import * as apiIndex from '@/sheep/api/index/index';
|
||||
import goods from '@/components/goods/goods.vue';
|
||||
|
||||
const money_obj = ref();
|
||||
const tagList = ref([]);
|
||||
|
||||
//获取钱包
|
||||
function getData() {
|
||||
api.getWallet().then((res) => {
|
||||
if (res.code === 0) {
|
||||
money_obj.value = res.data;
|
||||
}
|
||||
});
|
||||
// 标签列表
|
||||
apiIndex
|
||||
.getproducttaglist({
|
||||
categoryId: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
tagList.value = res.data || [];
|
||||
});
|
||||
}
|
||||
onLoad(() => {
|
||||
getData();
|
||||
});
|
||||
//充值提现弹框提示去跳转
|
||||
function jumpPage(typeTxt, url) {
|
||||
uni.showModal({
|
||||
// title: '',
|
||||
content: '是否去' + typeTxt,
|
||||
showCancel: true,
|
||||
success: (res) => {
|
||||
//用户点击确定
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
height: 318rpx;
|
||||
// background: linear-gradient(270deg, #75AFF6 0%, #366DEE 98.57%);
|
||||
margin: 32rpx;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
|
||||
.header-content {
|
||||
padding: 80rpx 32rpx 24rpx;
|
||||
|
||||
.title {
|
||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-family: Avenir, Avenir;
|
||||
font-weight: 900;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 394rpx;
|
||||
height: 4rpx;
|
||||
background: linear-gradient(
|
||||
117deg,
|
||||
rgba(255, 255, 255, 0.41) 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.title {
|
||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000;
|
||||
margin: 0 16rpx;
|
||||
}
|
||||
|
||||
.title-left {
|
||||
width: 42rpx;
|
||||
height: 6rpx;
|
||||
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 7.14%, #f25353 100%);
|
||||
}
|
||||
|
||||
.title-right {
|
||||
width: 42rpx;
|
||||
height: 6rpx;
|
||||
background: linear-gradient(-90deg, rgba(255, 255, 255, 0) 7.14%, #f25353 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user