feat: add paid resource order flow
This commit is contained in:
@@ -140,7 +140,7 @@ export function appGetUserById(userId) {
|
|||||||
// 查询积分记录列表
|
// 查询积分记录列表
|
||||||
export function listAppIntegra(query) {
|
export function listAppIntegra(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/app/appIntegra/list',
|
url: '/app/appIntegra/my',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@@ -273,3 +273,20 @@ export function getVirtualResourceOrder(orderNo, sync) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询当前用户的虚拟支付订单
|
||||||
|
export function listMyVirtualResourceOrders(query) {
|
||||||
|
return request({
|
||||||
|
url: '/app/virtual-pay/resource-orders',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消当前用户的待支付资源订单
|
||||||
|
export function cancelVirtualResourceOrder(orderNo) {
|
||||||
|
return request({
|
||||||
|
url: '/app/virtual-pay/resource-orders/' + orderNo,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
18
pages.json
18
pages.json
@@ -66,6 +66,14 @@
|
|||||||
"enablePullDownRefresh" : true
|
"enablePullDownRefresh" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/tool/integralCode",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "积分源码",
|
||||||
|
"enablePullDownRefresh" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/tool/resource",
|
"path" : "pages/tool/resource",
|
||||||
"style" :
|
"style" :
|
||||||
@@ -119,7 +127,15 @@
|
|||||||
"path" : "pages/mine/integral_record",
|
"path" : "pages/mine/integral_record",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "消费记录",
|
"navigationBarTitleText" : "积分记录",
|
||||||
|
"enablePullDownRefresh" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/mine/virtual_orders",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "我的订单",
|
||||||
"enablePullDownRefresh" : false
|
"enablePullDownRefresh" : false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,6 +33,36 @@
|
|||||||
selectable="true"> </mp-html> -->
|
selectable="true"> </mp-html> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 付费资源规格 -->
|
||||||
|
<view v-if="isLookAd == 3" class="spec-section">
|
||||||
|
<view class="resource-view">
|
||||||
|
<view class="resource-img2">
|
||||||
|
<image class="ui-img" src="https://img.yidaima.cn/feast/files.svg" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="resource-font2">选择版本</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="paySpecs.length" class="spec-list">
|
||||||
|
<view
|
||||||
|
v-for="item in paySpecs"
|
||||||
|
:key="item.id"
|
||||||
|
class="spec-item"
|
||||||
|
:class="{'spec-item-selected': selectedResourceListId == item.id}"
|
||||||
|
@click="selectSpec(item)"
|
||||||
|
>
|
||||||
|
<view class="spec-name">
|
||||||
|
{{item.listName}}
|
||||||
|
<text v-if="item.purchased" class="purchased-tag">已拥有</text>
|
||||||
|
<text v-else-if="item.status == 0" class="disabled-tag">已停用</text>
|
||||||
|
</view>
|
||||||
|
<view class="spec-price">
|
||||||
|
<text v-if="isUpgradeSpec(item)" class="upgrade-price-label">补</text>
|
||||||
|
¥{{formatPrice(getPayablePriceFen(item))}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="empty-spec">暂无可购买规格,请联系管理员</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 资源列表 -->
|
<!-- 资源列表 -->
|
||||||
<view>
|
<view>
|
||||||
<view class="resource-view">
|
<view class="resource-view">
|
||||||
@@ -40,11 +70,34 @@
|
|||||||
<image class="ui-img" src="https://img.yidaima.cn/feastwenjian.svg" mode="aspectFit"></image>
|
<image class="ui-img" src="https://img.yidaima.cn/feastwenjian.svg" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="resource-font2">
|
<view class="resource-font2">
|
||||||
资源列表
|
{{isLookAd == 3 ? '已购资源' : '资源列表'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<template v-if="isLookAd == 3">
|
||||||
|
<view v-if="purchasedSpecs.length" id="purchased-resources">
|
||||||
|
<view class="shuoming2">复制下方链接打开手机浏览器进行下载!!!</view>
|
||||||
|
<view v-for="item in purchasedSpecs" :key="item.id" class="file-list purchased-file">
|
||||||
|
<view class="resource-view">
|
||||||
|
<view class="resource-img3">
|
||||||
|
<image class="ui-img" src="https://img.yidaima.cn/feast/files.svg" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="resource-font3">
|
||||||
|
{{item.listName}}
|
||||||
|
<text class="password" v-if="item.password">密码:{{item.password}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="file-url-box">
|
||||||
|
<text class="file-url">{{item.listUrl}}</text>
|
||||||
|
<text @click="copy(item.listUrl)" class="file-copy">复制</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="shuoming2">选择上方版本并完成付款后,即可查看下载地址</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<view v-if="isLookAd == 0" class="shuoming2">复制下方链接打开手机浏览器进行下载!!!</view>
|
<view v-if="isLookAd == 0" class="shuoming2">复制下方链接打开手机浏览器进行下载!!!</view>
|
||||||
<view v-else class="shuoming2">请先点击下方按钮即可获取资源下载列表!</view>
|
<view v-else class="shuoming2">请先点击下方按钮即可获取资源下载列表!</view>
|
||||||
|
</template>
|
||||||
<template v-if="isLookAd == 0">
|
<template v-if="isLookAd == 0">
|
||||||
<view v-for="(item,index) in resourceInfo.appResourceListList" :key="index" class="file-list">
|
<view v-for="(item,index) in resourceInfo.appResourceListList" :key="index" class="file-list">
|
||||||
<view class="resource-view">
|
<view class="resource-view">
|
||||||
@@ -67,15 +120,31 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isLookAd ==1 || isLookAd == 2 || isLookAd == 3" style="height: 140rpx; width: 100%;"></view>
|
<view
|
||||||
|
v-if="(isLookAd == 1 || isLookAd == 2 || isLookAd == 3) && (isLookAd != 3 || selectedSpec)"
|
||||||
|
class="action-placeholder"
|
||||||
|
:class="{'action-placeholder-paid': isLookAd == 3}"
|
||||||
|
></view>
|
||||||
|
<view
|
||||||
|
v-if="(isLookAd == 1 || isLookAd == 2 || isLookAd == 3) && (isLookAd != 3 || selectedSpec)"
|
||||||
|
class="bottom-action-bar"
|
||||||
|
>
|
||||||
|
<view v-if="isLookAd == 3 && selectedSpec" class="action-summary">
|
||||||
|
<view class="action-summary-name">
|
||||||
|
<text class="action-summary-label">{{selectedIsUpgrade ? '升级补差' : '已选'}}</text>
|
||||||
|
<text class="action-summary-value">{{selectedSpec.listName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="action-summary-price">¥{{formatPrice(selectedPayPriceFen)}}</view>
|
||||||
|
</view>
|
||||||
<view v-if="isLookAd ==1" @click="lookAd()" class="resource-ad">
|
<view v-if="isLookAd ==1" @click="lookAd()" class="resource-ad">
|
||||||
广告查看
|
广告查看
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isLookAd ==2" @click="jfAd()" class="resource-ad">
|
<view v-if="isLookAd ==2" @click="jfAd()" class="resource-ad">
|
||||||
积分获取( {{resourceInfo.adNumber}} 积分 )
|
积分获取( {{resourceInfo.adNumber}} 积分 )
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isLookAd ==3" @click="payResource()" class="resource-ad">
|
<view v-if="isLookAd ==3 && selectedSpec" @click="handlePaidAction()" class="resource-ad" :class="{'resource-owned': selectedSpec.purchased}">
|
||||||
{{paying ? '支付结果确认中...' : '付费获取( ¥' + formatPrice(resourceInfo.priceFen) + ' )'}}
|
{{paidButtonText}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-toast ref="uToast"></u-toast>
|
<u-toast ref="uToast"></u-toast>
|
||||||
|
|
||||||
@@ -103,6 +172,7 @@
|
|||||||
},
|
},
|
||||||
isLookAd:null,
|
isLookAd:null,
|
||||||
paying: false,
|
paying: false,
|
||||||
|
selectedResourceListId: null,
|
||||||
tag_style: {
|
tag_style: {
|
||||||
h1: 'line-height: 50px;font-size:16px;',
|
h1: 'line-height: 50px;font-size:16px;',
|
||||||
h2: 'line-height: 50px;font-size:16px',
|
h2: 'line-height: 50px;font-size:16px',
|
||||||
@@ -115,6 +185,53 @@
|
|||||||
type:0
|
type:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
paySpecs() {
|
||||||
|
var list = this.resourceInfo.appResourceListList || [];
|
||||||
|
return list.filter(function(item) {
|
||||||
|
return item.status == 1 || item.purchased;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
purchasedSpecs() {
|
||||||
|
return this.paySpecs.filter(function(item) {
|
||||||
|
return !!item.purchased && !!item.listUrl;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
highestPurchasedSpec() {
|
||||||
|
var purchased = this.paySpecs.filter(function(item) {
|
||||||
|
return !!item.purchased;
|
||||||
|
});
|
||||||
|
purchased.sort(function(left, right) {
|
||||||
|
var sortDiff = Number(right.sortOrder || 0) - Number(left.sortOrder || 0);
|
||||||
|
return sortDiff || Number(right.id || 0) - Number(left.id || 0);
|
||||||
|
});
|
||||||
|
return purchased.length ? purchased[0] : null;
|
||||||
|
},
|
||||||
|
selectedSpec() {
|
||||||
|
var selectedId = this.selectedResourceListId;
|
||||||
|
return this.paySpecs.find(function(item) {
|
||||||
|
return String(item.id) === String(selectedId);
|
||||||
|
}) || null;
|
||||||
|
},
|
||||||
|
selectedPayPriceFen() {
|
||||||
|
return this.getPayablePriceFen(this.selectedSpec);
|
||||||
|
},
|
||||||
|
selectedIsUpgrade() {
|
||||||
|
return this.isUpgradeSpec(this.selectedSpec);
|
||||||
|
},
|
||||||
|
paidButtonText() {
|
||||||
|
if (!this.selectedSpec) {
|
||||||
|
return '暂无可购买规格';
|
||||||
|
}
|
||||||
|
if (this.selectedSpec.purchased) {
|
||||||
|
return '已购买,查看资源';
|
||||||
|
}
|
||||||
|
if (this.paying) {
|
||||||
|
return '支付结果确认中...';
|
||||||
|
}
|
||||||
|
return this.selectedIsUpgrade ? '补差价升级' : '立即购买';
|
||||||
|
}
|
||||||
|
},
|
||||||
// 分享好友配置
|
// 分享好友配置
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
var that = this;
|
var that = this;
|
||||||
@@ -150,6 +267,9 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.id = id
|
this.id = id
|
||||||
|
if (option && /^\d+$/.test(String(option.resourceListId || ''))) {
|
||||||
|
this.selectedResourceListId = option.resourceListId
|
||||||
|
}
|
||||||
if(option.type){
|
if(option.type){
|
||||||
this.type = option.type
|
this.type = option.type
|
||||||
}
|
}
|
||||||
@@ -278,6 +398,9 @@
|
|||||||
this.isLookAd = 3
|
this.isLookAd = 3
|
||||||
}
|
}
|
||||||
that.resourceInfo = response.data
|
that.resourceInfo = response.data
|
||||||
|
if (response.data.isAd == 3) {
|
||||||
|
that.selectDefaultSpec()
|
||||||
|
}
|
||||||
var str = that.resourceInfo.explain || ''
|
var str = that.resourceInfo.explain || ''
|
||||||
if (str.includes("/dev-api")) {
|
if (str.includes("/dev-api")) {
|
||||||
that.resourceInfo.explain = str.replace("/dev-api", that.baseUrl)
|
that.resourceInfo.explain = str.replace("/dev-api", that.baseUrl)
|
||||||
@@ -315,7 +438,9 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
copy(url){
|
copy(url){
|
||||||
var that = this;
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: url,
|
data: url,
|
||||||
showToast: false,
|
showToast: false,
|
||||||
@@ -324,6 +449,57 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
isUpgradeSpec(item){
|
||||||
|
if (!item || item.purchased || !this.highestPurchasedSpec) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Number(item.sortOrder || 0) > Number(this.highestPurchasedSpec.sortOrder || 0);
|
||||||
|
},
|
||||||
|
getPayablePriceFen(item){
|
||||||
|
if (!item) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var targetPrice = Number(item.priceFen || 0);
|
||||||
|
if (!this.isUpgradeSpec(item)) {
|
||||||
|
return targetPrice;
|
||||||
|
}
|
||||||
|
var ownedPrice = Number(this.highestPurchasedSpec.priceFen || 0);
|
||||||
|
return Math.max(targetPrice - ownedPrice, 0);
|
||||||
|
},
|
||||||
|
selectDefaultSpec(){
|
||||||
|
var currentId = this.selectedResourceListId;
|
||||||
|
var currentExists = this.paySpecs.some(function(item) {
|
||||||
|
return String(item.id) === String(currentId);
|
||||||
|
});
|
||||||
|
if (currentExists) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var firstUnpurchased = this.paySpecs.find(function(item) {
|
||||||
|
return item.status == 1 && !item.purchased;
|
||||||
|
});
|
||||||
|
this.selectedResourceListId = firstUnpurchased
|
||||||
|
? firstUnpurchased.id
|
||||||
|
: (this.paySpecs.length ? this.paySpecs[0].id : null);
|
||||||
|
},
|
||||||
|
selectSpec(item){
|
||||||
|
if (this.paying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.selectedResourceListId = item.id;
|
||||||
|
},
|
||||||
|
handlePaidAction(){
|
||||||
|
if (!this.selectedSpec) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.selectedSpec.purchased) {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
selector: '#purchased-resources',
|
||||||
|
duration: 250
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.payResource();
|
||||||
|
},
|
||||||
payResource(){
|
payResource(){
|
||||||
var that = this;
|
var that = this;
|
||||||
if (this.paying) {
|
if (this.paying) {
|
||||||
@@ -336,7 +512,14 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.resourceInfo.priceFen || this.resourceInfo.priceFen <= 0) {
|
if (!this.selectedSpec || this.selectedSpec.status != 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择可购买的版本',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.selectedPayPriceFen || this.selectedPayPriceFen <= 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '价格信息错误',
|
title: '价格信息错误',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -356,7 +539,7 @@
|
|||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: loginRes => {
|
success: loginRes => {
|
||||||
createVirtualResourceOrder({
|
createVirtualResourceOrder({
|
||||||
resourceId: that.id,
|
resourceListId: that.selectedSpec.id,
|
||||||
code: loginRes.code
|
code: loginRes.code
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
var payParams = response.data;
|
var payParams = response.data;
|
||||||
@@ -403,6 +586,7 @@
|
|||||||
message: '购买成功',
|
message: '购买成功',
|
||||||
icon: false
|
icon: false
|
||||||
});
|
});
|
||||||
|
resourceDownLoad({id: that.id}).then(function() {});
|
||||||
that.getInfo();
|
that.getInfo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -476,18 +660,145 @@
|
|||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
}
|
}
|
||||||
.resource-ad{
|
.resource-ad{
|
||||||
height: 100rpx;
|
height: 88rpx;
|
||||||
width: 90%;
|
width: 100%;
|
||||||
margin-left: 5%;
|
margin: 0;
|
||||||
margin-bottom: 40rpx;
|
|
||||||
border-radius: 100rpx;
|
border-radius: 100rpx;
|
||||||
background: #7a60fd;
|
background: #7a60fd;
|
||||||
position: absolute;
|
line-height: 88rpx;
|
||||||
bottom: 0; /* 将按钮固定在容器的底部 */
|
|
||||||
line-height: 100rpx;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 38rpx;
|
font-size: 34rpx;
|
||||||
color: white;
|
color: white;
|
||||||
|
box-shadow: 0 8rpx 22rpx rgba(122, 96, 253, 0.22);
|
||||||
|
}
|
||||||
|
.bottom-action-bar{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 99;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
padding: 18rpx 5% calc(18rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding: 18rpx 5% calc(18rpx + env(safe-area-inset-bottom));
|
||||||
|
background: rgba(255, 255, 255, 0.98);
|
||||||
|
border-top: 1rpx solid #eeeeee;
|
||||||
|
box-shadow: 0 -10rpx 30rpx rgba(45, 45, 45, 0.1);
|
||||||
|
}
|
||||||
|
.action-summary{
|
||||||
|
height: 54rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 12rpx 12rpx;
|
||||||
|
}
|
||||||
|
.action-summary-name{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.action-summary-label{
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
padding: 3rpx 12rpx;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
font-size: 21rpx;
|
||||||
|
color: #6d52f5;
|
||||||
|
background: #f0ecff;
|
||||||
|
}
|
||||||
|
.action-summary-value{
|
||||||
|
max-width: 420rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 27rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.action-summary-price{
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 31rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #e54d42;
|
||||||
|
}
|
||||||
|
.action-placeholder{
|
||||||
|
width: 100%;
|
||||||
|
height: calc(142rpx + constant(safe-area-inset-bottom));
|
||||||
|
height: calc(142rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
.action-placeholder-paid{
|
||||||
|
height: calc(208rpx + constant(safe-area-inset-bottom));
|
||||||
|
height: calc(208rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
.resource-owned{
|
||||||
|
background: #39b54a;
|
||||||
|
}
|
||||||
|
.spec-section{
|
||||||
|
margin-bottom: 45rpx;
|
||||||
|
}
|
||||||
|
.spec-list{
|
||||||
|
margin: 24rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.spec-item{
|
||||||
|
min-height: 92rpx;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
padding: 0 28rpx;
|
||||||
|
border: 2rpx solid #e5e5e5;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
.spec-item-selected{
|
||||||
|
border-color: #7a60fd;
|
||||||
|
background: #f5f2ff;
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(122, 96, 253, 0.12);
|
||||||
|
}
|
||||||
|
.spec-name{
|
||||||
|
font-size: 29rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #2b2b2b;
|
||||||
|
}
|
||||||
|
.spec-price{
|
||||||
|
font-size: 31rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #e54d42;
|
||||||
|
}
|
||||||
|
.upgrade-price-label{
|
||||||
|
margin-right: 6rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #7a60fd;
|
||||||
|
}
|
||||||
|
.purchased-tag,
|
||||||
|
.disabled-tag{
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
padding: 4rpx 12rpx;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
font-size: 21rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.purchased-tag{
|
||||||
|
color: #248b3e;
|
||||||
|
background: #e8f7ec;
|
||||||
|
}
|
||||||
|
.disabled-tag{
|
||||||
|
color: #8799a3;
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
.empty-spec{
|
||||||
|
margin: 24rpx 10rpx;
|
||||||
|
padding: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
color: #8799a3;
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
.purchased-file{
|
||||||
|
padding: 24rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: #fafafa;
|
||||||
}
|
}
|
||||||
.file-list{
|
.file-list{
|
||||||
margin: 30rpx;
|
margin: 30rpx;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</swiper>
|
</swiper>
|
||||||
</uni-swiper-dot> -->
|
</uni-swiper-dot> -->
|
||||||
<view class="index-info">
|
<view class="index-info">
|
||||||
<view class="mt30 grid text-center col-3 bg-white" style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
<view class="mt30 grid text-center col-4 bg-white" style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
||||||
<view @click="Jump('/pages/tool/highQualityCode')">
|
<view @click="Jump('/pages/tool/highQualityCode')">
|
||||||
<image class="cell_3_icon flex justify-center align-center" style="height:65rpx;" src="https://img.yidaima.cn/feast/sjbz.png" mode="aspectFit">
|
<image class="cell_3_icon flex justify-center align-center" style="height:65rpx;" src="https://img.yidaima.cn/feast/sjbz.png" mode="aspectFit">
|
||||||
</image>
|
</image>
|
||||||
@@ -33,6 +33,11 @@
|
|||||||
</image>
|
</image>
|
||||||
<view>资源分享</view>
|
<view>资源分享</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view @click="Jump('/pages/tool/integralCode')">
|
||||||
|
<image class="cell_3_icon flex justify-center align-center" style="height: 65rpx;" src="https://img.yidaima.cn/feast/sp.png" mode="aspectFit">
|
||||||
|
</image>
|
||||||
|
<view>积分源码</view>
|
||||||
|
</view>
|
||||||
<view @click="Jump('/pages/tool/freeCode')">
|
<view @click="Jump('/pages/tool/freeCode')">
|
||||||
<image class="cell_3_icon flex justify-center align-center" style="height: 65rpx;" src="https://img.yidaima.cn/feast/sycc.png" mode="aspectFit">
|
<image class="cell_3_icon flex justify-center align-center" style="height: 65rpx;" src="https://img.yidaima.cn/feast/sycc.png" mode="aspectFit">
|
||||||
</image>
|
</image>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<!-- <view style="width: 100%; margin-top: 30rpx;">
|
<!-- <view style="width: 100%; margin-top: 30rpx;">
|
||||||
<ad-custom unit-id="adunit-ff28399b17818338" ad-intervals="30" ></ad-custom>
|
<ad-custom unit-id="adunit-ff28399b17818338" ad-intervals="30" ></ad-custom>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="mt30 grid text-center col-3 bg-white"
|
<view class="mt30 grid text-center col-4 bg-white"
|
||||||
style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
||||||
<view @click="exchange()">
|
<view @click="exchange()">
|
||||||
<view class="cell_3_icon flex justify-center align-center"><text
|
<view class="cell_3_icon flex justify-center align-center"><text
|
||||||
@@ -68,7 +68,12 @@
|
|||||||
<view @click="integralRecord()">
|
<view @click="integralRecord()">
|
||||||
<view class="cell_3_icon flex justify-center align-center"><text class="text-cyan cuIcon-coin"></text>
|
<view class="cell_3_icon flex justify-center align-center"><text class="text-cyan cuIcon-coin"></text>
|
||||||
</view>
|
</view>
|
||||||
<view>消费记录</view>
|
<view>积分记录</view>
|
||||||
|
</view>
|
||||||
|
<view @click="virtualOrders()">
|
||||||
|
<view class="cell_3_icon flex justify-center align-center"><text class="text-purple cuIcon-form"></text>
|
||||||
|
</view>
|
||||||
|
<view>我的订单</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -318,6 +323,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
virtualOrders(){
|
||||||
|
var that = this
|
||||||
|
if (!this.userid) {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
type: 'success',
|
||||||
|
title: '',
|
||||||
|
message: "请先授权登录",
|
||||||
|
icon: false
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$tab.navigateTo('/pages/mine/virtual_orders')
|
||||||
|
}
|
||||||
|
},
|
||||||
Signin() {
|
Signin() {
|
||||||
var that = this
|
var that = this
|
||||||
if (!this.userid) {
|
if (!this.userid) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<view v-if="dataList.length != 0" class="re-box">
|
<view v-if="dataList.length != 0" class="re-box">
|
||||||
<view>
|
<view>
|
||||||
<text style="font-size: 40rpx;color: #0081ff;" class="cuIcon-titles"></text><text style="font-size: 35rpx;">消费明细</text>
|
<text style="font-size: 40rpx;color: #0081ff;" class="cuIcon-titles"></text><text style="font-size: 35rpx;">积分明细</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 40rpx;">
|
<view style="margin-top: 40rpx;">
|
||||||
<view v-for="(item,index) in dataList" :key="index" class="flex solid-bottom padding justify-between">
|
<view v-for="(item,index) in dataList" :key="index" class="flex solid-bottom padding justify-between">
|
||||||
@@ -20,10 +20,6 @@
|
|||||||
<view v-if="item.isAdd == 1" style="color: #07C160;" class="re-number">-{{item.integralNumber}}
|
<view v-if="item.isAdd == 1" style="color: #07C160;" class="re-number">-{{item.integralNumber}}
|
||||||
<text class="cuIcon-vip" style="margin-left: 15rpx;font-size: 40rpx;"></text>
|
<text class="cuIcon-vip" style="margin-left: 15rpx;font-size: 40rpx;"></text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.isAdd == 3" style="color: #07C160;" class="re-number">-¥{{formatMoney(item.integralNumber)}}
|
|
||||||
<text class="cuIcon-recharge" style="margin-left: 15rpx;font-size: 40rpx;"></text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -52,9 +48,7 @@
|
|||||||
return {
|
return {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10
|
||||||
userId: uni.getStorageSync("userInfo").userId,
|
|
||||||
|
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
@@ -91,9 +85,6 @@
|
|||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatMoney(priceFen) {
|
|
||||||
return (Number(priceFen || 0) / 100).toFixed(2)
|
|
||||||
},
|
|
||||||
getDataList(){
|
getDataList(){
|
||||||
var that = this;
|
var that = this;
|
||||||
listAppIntegra(this.queryParams).then(response => {
|
listAppIntegra(this.queryParams).then(response => {
|
||||||
|
|||||||
330
pages/mine/virtual_orders.vue
Normal file
330
pages/mine/virtual_orders.vue
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
<template>
|
||||||
|
<view class="order-page">
|
||||||
|
<view class="page-title">我的订单</view>
|
||||||
|
|
||||||
|
<view v-if="orderList.length" class="order-list">
|
||||||
|
<view v-for="item in orderList" :key="item.orderNo" class="order-card">
|
||||||
|
<view class="order-head">
|
||||||
|
<text class="order-no">订单号:{{item.orderNo}}</text>
|
||||||
|
<text class="order-status" :class="'status-' + item.status">{{statusText(item.status)}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="resource-title">{{item.resourceTitle || '资源已删除'}}</view>
|
||||||
|
<view class="order-row">
|
||||||
|
<text class="row-label">购买版本</text>
|
||||||
|
<text class="row-value spec-name">{{item.specName || '旧版整项资源'}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-row">
|
||||||
|
<text class="row-label">下单时间</text>
|
||||||
|
<text class="row-value">{{item.createTime || '-'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-footer">
|
||||||
|
<view class="price-box">
|
||||||
|
<text class="price-label">实付</text>
|
||||||
|
<text class="price-value">¥{{formatPrice(item.priceFen)}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-actions">
|
||||||
|
<view
|
||||||
|
v-if="item.status === 0"
|
||||||
|
class="order-action cancel-action"
|
||||||
|
:class="{'action-disabled': cancellingOrderNo === item.orderNo}"
|
||||||
|
@click.stop="cancelOrder(item)"
|
||||||
|
>取消订单</view>
|
||||||
|
<view class="order-action" @click="openResource(item)">{{actionText(item.status)}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-else-if="!loading" class="empty-box">
|
||||||
|
<text class="cuIcon-form empty-icon"></text>
|
||||||
|
<view class="empty-title">暂无购买订单</view>
|
||||||
|
<view class="empty-tip">购买付费资源后,订单会显示在这里</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="loading" class="loading-text">加载中...</view>
|
||||||
|
<view v-else-if="orderList.length && !hasMore" class="bottom-text">— 已经到底了 —</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listMyVirtualResourceOrders,
|
||||||
|
cancelVirtualResourceOrder
|
||||||
|
} from "@/api/app/index.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
orderList: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
hasMore: true,
|
||||||
|
cancellingOrderNo: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.loadOrders(true)
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.loading && this.hasMore) {
|
||||||
|
this.queryParams.pageNum++
|
||||||
|
this.loadOrders(false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadOrders(reset) {
|
||||||
|
if (this.loading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (reset) {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.orderList = []
|
||||||
|
this.total = 0
|
||||||
|
this.hasMore = true
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
listMyVirtualResourceOrders(this.queryParams).then(response => {
|
||||||
|
var rows = response.rows || []
|
||||||
|
this.orderList = reset ? rows : this.orderList.concat(rows)
|
||||||
|
this.total = Number(response.total || 0)
|
||||||
|
this.hasMore = this.orderList.length < this.total
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
statusText(status) {
|
||||||
|
return {
|
||||||
|
0: '待支付',
|
||||||
|
1: '已支付',
|
||||||
|
2: '已退款',
|
||||||
|
3: '已关闭'
|
||||||
|
}[status] || '未知状态'
|
||||||
|
},
|
||||||
|
actionText(status) {
|
||||||
|
return status === 1 ? '查看资源' : (status === 0 ? '继续支付' : '重新购买')
|
||||||
|
},
|
||||||
|
formatPrice(priceFen) {
|
||||||
|
return (Number(priceFen || 0) / 100).toFixed(2)
|
||||||
|
},
|
||||||
|
cancelOrder(item) {
|
||||||
|
if (item.status !== 0 || this.cancellingOrderNo) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '取消订单',
|
||||||
|
content: '确定要取消这笔待支付订单吗?',
|
||||||
|
confirmText: '取消订单',
|
||||||
|
confirmColor: '#e54d42',
|
||||||
|
success: result => {
|
||||||
|
if (!result.confirm) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.cancellingOrderNo = item.orderNo
|
||||||
|
cancelVirtualResourceOrder(item.orderNo).then(() => {
|
||||||
|
item.status = 3
|
||||||
|
uni.showToast({
|
||||||
|
title: '订单已取消',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
this.cancellingOrderNo = ''
|
||||||
|
}).catch(() => {
|
||||||
|
this.cancellingOrderNo = ''
|
||||||
|
this.loadOrders(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openResource(item) {
|
||||||
|
if (!item.resourceId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var url = '/pages/blog/resource?id=' + item.resourceId + '&type=1'
|
||||||
|
if (item.resourceListId) {
|
||||||
|
url += '&resourceListId=' + item.resourceListId
|
||||||
|
}
|
||||||
|
this.$tab.navigateTo(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background: #f5f6f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 10rpx 4rpx 28rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #202020;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card {
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
padding: 28rpx;
|
||||||
|
border-radius: 22rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(50, 50, 50, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-head,
|
||||||
|
.order-row,
|
||||||
|
.order-footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-head {
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
border-bottom: 1rpx solid #eeeeee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-no {
|
||||||
|
max-width: 500rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 23rpx;
|
||||||
|
color: #9a9a9a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-status {
|
||||||
|
font-size: 25rpx;
|
||||||
|
color: #8a8a8a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-0 {
|
||||||
|
color: #ff9700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-1 {
|
||||||
|
color: #20a05a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-2 {
|
||||||
|
color: #e54d42;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resource-title {
|
||||||
|
margin: 24rpx 0;
|
||||||
|
font-size: 31rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #242424;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-row {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-label {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-value {
|
||||||
|
margin-left: 28rpx;
|
||||||
|
text-align: right;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spec-name {
|
||||||
|
color: #7258ee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-footer {
|
||||||
|
margin-top: 26rpx;
|
||||||
|
padding-top: 22rpx;
|
||||||
|
border-top: 1rpx solid #eeeeee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-label {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-value {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #e54d42;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-action {
|
||||||
|
min-width: 150rpx;
|
||||||
|
height: 58rpx;
|
||||||
|
padding: 0 22rpx;
|
||||||
|
border: 2rpx solid #765cf4;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
line-height: 58rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 25rpx;
|
||||||
|
color: #765cf4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-actions .order-action + .order-action {
|
||||||
|
margin-left: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-action {
|
||||||
|
min-width: 130rpx;
|
||||||
|
border-color: #d8d8d8;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-box {
|
||||||
|
padding-top: 220rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #a5a5a5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon {
|
||||||
|
font-size: 100rpx;
|
||||||
|
color: #c8cfdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-title {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
font-size: 31rpx;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-tip {
|
||||||
|
margin-top: 12rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-text,
|
||||||
|
.bottom-text {
|
||||||
|
padding: 28rpx 0 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #aaaaaa;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
需要的小伙伴请尽快转存,随时可能失效
|
需要的小伙伴请尽快转存,随时可能失效
|
||||||
</view>
|
</view>
|
||||||
<view class="container-search">
|
<view class="container-search">
|
||||||
<uni-search-bar v-model="searchValue" style="opacity: 0.9;" radius="190" placeholder="搜索一下,爱上这个世界"
|
<uni-search-bar v-model="searchValue" style="opacity: 0.9;" radius="190" placeholder="搜一搜,发现你需要的源码"
|
||||||
@confirm="search" cancelButton="none" bgColor="#fff" />
|
@confirm="search" cancelButton="none" bgColor="#fff" />
|
||||||
</view>
|
</view>
|
||||||
</image>
|
</image>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
需要的小伙伴请尽快转存,随时可能失效
|
需要的小伙伴请尽快转存,随时可能失效
|
||||||
</view>
|
</view>
|
||||||
<view class="container-search">
|
<view class="container-search">
|
||||||
<uni-search-bar v-model="searchValue" style="opacity: 0.9;" radius="190" placeholder="搜索一下,爱上这个世界"
|
<uni-search-bar v-model="searchValue" style="opacity: 0.9;" radius="190" placeholder="搜一搜,发现你需要的源码"
|
||||||
@confirm="search" cancelButton="none" bgColor="#fff" />
|
@confirm="search" cancelButton="none" bgColor="#fff" />
|
||||||
</view>
|
</view>
|
||||||
</image>
|
</image>
|
||||||
|
|||||||
457
pages/tool/integralCode.vue
Normal file
457
pages/tool/integralCode.vue
Normal file
@@ -0,0 +1,457 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<image class="container" src="https://img.yidaima.cn/feast/xinkong.gif">
|
||||||
|
<view class="container-h">
|
||||||
|
积分源码专区
|
||||||
|
</view>
|
||||||
|
<view class="container-slog">
|
||||||
|
需要的小伙伴请尽快转存,随时可能失效
|
||||||
|
</view>
|
||||||
|
<view class="container-search">
|
||||||
|
<uni-search-bar v-model="searchValue" style="opacity: 0.9;" radius="190" placeholder="搜一搜,发现你需要的源码"
|
||||||
|
@confirm="search" cancelButton="none" bgColor="#fff" />
|
||||||
|
</view>
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<!-- 热门文章 -->
|
||||||
|
<view class="titel-felx">
|
||||||
|
<view class="time-img">
|
||||||
|
<image style="width: 100%;height: 100%;" src="https://img.yidaima.cn/feast/dstrict-3.svg" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="titel-h-go">
|
||||||
|
积分源码
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 文章列表 -->
|
||||||
|
<view v-if="blogList.length != 0" style="margin: 0 25rpx;">
|
||||||
|
<view class="blog-box" v-for="(item,index) in blogList" :key="index" @click="blogInfo(item.id)">
|
||||||
|
<view v-show="false" style="height: 370rpx;background-color: white;overflow: hidden;padding: 25rpx;border-radius: 30rpx;" v-if="item.ad == 1 && adUnitId">
|
||||||
|
<view style="height: 325rpx;overflow: hidden;">
|
||||||
|
<ad-custom style="height: 325rpx !important" :unit-id="adUnitId" ad-intervals="30" ></ad-custom>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="height: 200rpx;" v-else>
|
||||||
|
<image class="blog-img" :src="$image.articleThumbnail(item)" lazy-load mode="aspectFill"></image>
|
||||||
|
<view class="info-box">
|
||||||
|
<view class="ellipsis-multiline">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="info-icon">
|
||||||
|
<image v-if="item.appResource.isAd == 0" class="muen-sld-icon" src="https://img.yidaima.cn/mf.svg" mode=""></image>
|
||||||
|
<image v-if="item.appResource.isAd == 1" class="muen-sld-icon" src="https://img.yidaima.cn/feast/guanggao.svg" mode=""></image>
|
||||||
|
<image v-if="item.appResource.isAd == 2" class="muen-sld-icon" src="https://img.yidaima.cn/jf.svg" mode=""></image>
|
||||||
|
<image v-if="item.appResource.isAd == 3" class="muen-sld-icon" src="https://img.yidaima.cn/ff.svg" mode=""></image>
|
||||||
|
<image v-if="item.appResourceId" class="muen-sld-icon" src="https://img.yidaima.cn/feast/xiazai.svg" mode=""></image>
|
||||||
|
<image v-if="item.weight == 999" class="muen-sld-icon2" src="https://img.yidaima.cn/feast/top.svg" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="muen-sld-time">{{item.createTime}}<text
|
||||||
|
class="cuIcon-attention look-number"><text>{{item.lookNumber}}</text></text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view style="text-align: center;" v-else>
|
||||||
|
<image style="width: 400rpx;height: 200rpx;" src="https://img.yidaima.cn/feast/nodata.svg"></image>
|
||||||
|
<view style="color: #adadad;">无数据</view>
|
||||||
|
</view>
|
||||||
|
<!-- 加载动图 -->
|
||||||
|
<view class="artileload" v-if="showTotal">
|
||||||
|
<image style="width: 100%;height: 100%;" src="https://img.yidaima.cn/feast/articleload.gif" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<!-- 文章列表没有数据 -->
|
||||||
|
<view class="no-list-data" v-else>
|
||||||
|
--我的底线就到这里了--
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listArticle,
|
||||||
|
getDicts,
|
||||||
|
} from "@/api/app/index.js"
|
||||||
|
import config from '@/config'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
baseUrl: config.baseUrl,
|
||||||
|
adUnitId:"",
|
||||||
|
ColorList: [{
|
||||||
|
name: 'red',
|
||||||
|
color: '#e54d42'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'orange',
|
||||||
|
color: '#f37b1d'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'yellow',
|
||||||
|
color: '#fbbd08'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'olive',
|
||||||
|
color: '#8dc63f'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'green',
|
||||||
|
color: '#39b54a'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cyan',
|
||||||
|
color: '#1cbbb4'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'blue',
|
||||||
|
color: '#0081ff'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'purple',
|
||||||
|
color: '#6739b6'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'mauve',
|
||||||
|
color: '#9c26b0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'pink',
|
||||||
|
color: '#e03997'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'brown',
|
||||||
|
color: '#a5673f'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'grey',
|
||||||
|
color: '#8799a3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'gray',
|
||||||
|
color: '#aaaaaa'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'black',
|
||||||
|
color: '#333333'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'white',
|
||||||
|
color: '#ffffff'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
searchValue: null,
|
||||||
|
blogList: [],
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 7,
|
||||||
|
isShow: 1,
|
||||||
|
articleType: 4,
|
||||||
|
keyword: null,
|
||||||
|
orderType: "look_number"
|
||||||
|
},
|
||||||
|
bLogTypeList: [],
|
||||||
|
total: 0,
|
||||||
|
showTotal: false,
|
||||||
|
platform: 0
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.adUnitId = uni.getStorageSync("sysSet").computerAd
|
||||||
|
wx.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res.platform)
|
||||||
|
if (res.platform == 'mac' || res.platform == 'windows') {
|
||||||
|
this.platform = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//获取文章列表
|
||||||
|
this.getBlogList()
|
||||||
|
//获取文章类型标签
|
||||||
|
getDicts("article_type").then(response => {
|
||||||
|
this.bLogTypeList = [];
|
||||||
|
var randomNumber = this.getRandomNumber(0, 14, response.data.length)
|
||||||
|
for (var i = 0; i < response.data.length; i++) {
|
||||||
|
var type = {
|
||||||
|
title: response.data[i].dictLabel,
|
||||||
|
name: this.ColorList[randomNumber[i]].name,
|
||||||
|
color: this.ColorList[randomNumber[i]].color,
|
||||||
|
typeVal: response.data[i].dictValue
|
||||||
|
}
|
||||||
|
this.bLogTypeList.push(type)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 下拉刷新
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 7,
|
||||||
|
isShow: 1,
|
||||||
|
articleType: 4,
|
||||||
|
keyword: null,
|
||||||
|
orderType: "look_number"
|
||||||
|
}
|
||||||
|
this.searchValue = null
|
||||||
|
this.getBlogList()
|
||||||
|
},
|
||||||
|
// 上拉分页
|
||||||
|
onReachBottom() {
|
||||||
|
var that = this;
|
||||||
|
var allTotal = this.queryParams.pageNum * this.queryParams.pageSize
|
||||||
|
//this.page为加载次数,this.pageSize为每一次加载的数据条数
|
||||||
|
if (allTotal < this.total) {
|
||||||
|
//this.total为请求数据的总条数。只要现有条数小于总条数就执行一下代码
|
||||||
|
this.showTotal = true;
|
||||||
|
this.queryParams.pageNum++;
|
||||||
|
//加载次数递加
|
||||||
|
//请求更多数据列表
|
||||||
|
listArticle(this.queryParams).then(response => {
|
||||||
|
if(that.platform == 0 && that.adUnitId){
|
||||||
|
that.blogList.push({ad:1})
|
||||||
|
}
|
||||||
|
that.blogList = that.blogList.concat(response.rows)
|
||||||
|
var allTotal2 = this.queryParams.pageNum * this.queryParams.pageSize
|
||||||
|
if (allTotal2 < this.total) {
|
||||||
|
//this.total为请求数据的总条数。只要现有条数小于总条数就执行一下代码
|
||||||
|
this.showTotal = true;
|
||||||
|
} else {
|
||||||
|
this.showTotal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.showTotal = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 搜索触发
|
||||||
|
search(e) {
|
||||||
|
var json = e.value;
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.queryParams.articleType = 4
|
||||||
|
this.queryParams.keyword = json
|
||||||
|
this.getBlogList()
|
||||||
|
},
|
||||||
|
|
||||||
|
getRandomNumber(min, max, count) {
|
||||||
|
const randoms = new Set();
|
||||||
|
while (randoms.size < count) {
|
||||||
|
const random = Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
randoms.add(random);
|
||||||
|
}
|
||||||
|
return [...randoms];
|
||||||
|
},
|
||||||
|
|
||||||
|
getBlogList() {
|
||||||
|
var that = this;
|
||||||
|
listArticle(this.queryParams).then(response => {
|
||||||
|
that.blogList = response.rows
|
||||||
|
var allTotal = this.queryParams.pageNum * this.queryParams.pageSize
|
||||||
|
that.total = response.total
|
||||||
|
if (allTotal < this.total) {
|
||||||
|
this.showTotal = true;
|
||||||
|
} else {
|
||||||
|
this.showTotal = false;
|
||||||
|
}
|
||||||
|
if(that.platform == 0 && that.adUnitId){
|
||||||
|
that.blogList.splice(2, 0, {ad:1});
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh(); //停止刷新
|
||||||
|
})
|
||||||
|
},
|
||||||
|
blogInfo(id) {
|
||||||
|
this.$tab.navigateTo('/pages/blog/bloginfo?id=' + id)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #fff;
|
||||||
|
min-height: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 列表没有数据 */
|
||||||
|
.no-list-data {
|
||||||
|
text-align: center;
|
||||||
|
margin: 30rpx 0px;
|
||||||
|
color: #e6e6e6;
|
||||||
|
font-size: 24upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 加载动图 */
|
||||||
|
.artileload {
|
||||||
|
height: 80rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
margin: 20rpx auto;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-tile {
|
||||||
|
width: 100%;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overfor-x {
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-h {
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 36upx;
|
||||||
|
position: absolute;
|
||||||
|
top: 70upx;
|
||||||
|
left: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-slog {
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 24upx;
|
||||||
|
position: absolute;
|
||||||
|
top: 140upx;
|
||||||
|
left: 10%
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-search {
|
||||||
|
position: absolute;
|
||||||
|
width: 88%;
|
||||||
|
top: 200upx;
|
||||||
|
left: 6%
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: 4% 30upx;
|
||||||
|
width: 92%;
|
||||||
|
height: 320rpx;
|
||||||
|
border-radius: 20upx;
|
||||||
|
/* padding: 30upx; */
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标签 */
|
||||||
|
.swiper-list {
|
||||||
|
margin: 30upx 0upx 10upx 0upx;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-list {
|
||||||
|
padding: 12upx 36upx;
|
||||||
|
background-color: #596982;
|
||||||
|
border-radius: 100upx;
|
||||||
|
margin-left: 30upx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 28upx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-list:last-child {
|
||||||
|
margin-right: 30upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 热门 */
|
||||||
|
.time-img {
|
||||||
|
height: 40upx;
|
||||||
|
width: 40upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-h-ad {
|
||||||
|
height: 240upx;
|
||||||
|
border-radius: 16upx;
|
||||||
|
margin: 48upx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titel-felx {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 28upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titel-h-go {
|
||||||
|
font-size: 32upx;
|
||||||
|
margin-left: 20upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文章列表 */
|
||||||
|
.blog-box {
|
||||||
|
width: 100%;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blog-img {
|
||||||
|
height: 150rpx;
|
||||||
|
width: 33%;
|
||||||
|
margin-top: 25rpx;
|
||||||
|
margin-left: 25rpx;
|
||||||
|
border-radius: 25rpx;
|
||||||
|
display: inline-block;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.muen-sld-time {
|
||||||
|
font-size: 22rpx;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
margin-left: 25rpx;
|
||||||
|
float: left;
|
||||||
|
color: #ADADAD;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.muen-sld-icon {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-left: 25rpx;
|
||||||
|
margin-top: 17rpx;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box {
|
||||||
|
width: 58%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ellipsis-multiline {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
margin-left: 25rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.look-number {
|
||||||
|
font-size: 22rpx;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.look-number text {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-icon {
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
</style></style>
|
||||||
Reference in New Issue
Block a user