no message

This commit is contained in:
2025-08-17 01:13:23 +08:00
parent e1d02806fc
commit 7ec3693bab
12 changed files with 37 additions and 37 deletions
+192
View File
@@ -0,0 +1,192 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="查看合同" />
<view class="contract-view">
<view class="top-info flex-r-lr">
<image src="@/static/new/he.png"></image>
<view class="right-view">
<text class="text-36 text-zu">消费型合伙人协议</text>
<view class="bottom-panel">
<view class="flex-r-lr mt-24" v-for="(item,index) in dataList" :key="dataList.value">
<text class="text-fu text-24">{{item.text}}</text>
<view class="list-right">
<text class="text-24"
:class="{'text-lu':index == 0,'text-zu':index != 0}">{{item.value}}</text>
</view>
</view>
</view>
</view>
</view>
<text class="text-zu text-32 mt-32" style="margin-left:38rpx">合同签约人信息</text>
<view class="bottom">
<view class="bottom-lsit" v-for="(item,index) in bottomList" :key="item.value">
<text class="text-24 text-fu" style="min-width:184rpx;display: inline-block;">{{item.text}}</text>
<text class="text-24 text-zu">{{item.value}}</text>
</view>
</view>
<view class="bottom-btn">
<view class="right-btn flex-c" @click="onOpen">
<text class="text-white text-32">下载合同</text>
</view>
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import { getUserInfo } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import ContractItem from './components/contract-item.vue'
import { getContractList,fileUrls } from '@/api/contract.js'
import func from '@/utils/func.js';
export default {
components: { Header,TopSafe,ContractItem },
data() {
return {
dataList:[
{text:'合同状态',value:'签约完成'},
{text:'合同编号',value:'69485222011627525'},
{text:'发起方',value:'信任桥(深圳)网络科技有限公司'},
{text:'发起时间',value:'2025-08-11 12:00:00'},
{text:'完成结束时间',value:'2025-08-11 12:00:00'},
],
bottomList:[
{text:'签约人',value:'信任桥会员 章三'},
{text:'状态',value:'已签署'},
{text:'时间',value:'2025-08-11 12:00:00'},
],
obj:null,
url:''
};
},
onLoad(option) {
this.init();
},
methods: {
init(){
this.isSignContract()
},
getfileUrls(){
let params = {
businessType:'FLOW',
businessIds:[this.obj.flowId]
}
fileUrls(params).then(res=>{
if(res.bizcode == 100){
this.url = res.data.fileUrls[0].url;
}else{
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
}
})
},
isSignContract(){
getContractList().then(res=>{
if(res.bizcode == 100){
this.obj = JSON.parse(JSON.stringify(res.data[0]));
this.obj.time = func.formatDate(new Date(res.data[0].signatureTime),2);
this.obj.details.startTime = func.formatDate(new Date(res.data[0].details.startTime),2);
this.obj.details.endTime = func.formatDate(new Date(res.data[0].details.endTime),2);
this.dataList[2].value = this.obj.flowId;
this.dataList[3].value = this.obj.details.startTime;
this.dataList[4].value = this.obj.details.endTime;
this.bottomList[0].value = this.obj.signatureName;
this.bottomList[2].value = this.obj.time;
this.getfileUrls();
}else{
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
}
})
},
onOpen(){
// window.open(this.obj.contractName,'_blank')
window.open(this.url,'_blank')
}
}
}
</script>
<style lang="scss" scoped>
.contract-view{
width:100%;
height:calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
overflow-y: auto;
// padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.bottom-btn{
width:100%;
display: flex;
position: absolute;
bottom:80rpx;
flex-direction: row;
justify-content: center;
.left-btn{
width:48%;
background: #E4D6FD;
border-radius: 8rpx;
}
.right-btn{
width:calc(100% - 60rpx);
height:88rpx;
background: linear-gradient( 270deg, #B164FB 0%, #7934F6 100%);
border-radius: 8rpx;
}
}
.bottom{
display: flex;
padding: 40rpx 46rpx;
box-sizing: border-box;
flex-direction: column;
justify-content: space-between;
margin-top:24rpx;
background-color: #fff;
width:100%;
min-height:216rpx;
}
.top-info{
width:100%;
min-height:440rpx;
padding: 68rpx 32rpx 64rpx;
box-sizing: border-box;
background-color: #fff;
.right-view{
height:100%;
flex:1;
flex-direction: column;
display: flex;
margin-left:46rpx;
.bottom-panel{
width:100%;
flex:1;
display: flex;
flex-direction: column;
.list-right{
width:238rpx;
margin-left:40rpx;
word-break:break-all;
display: flex;
}
}
}
image{
width:200rpx;
height:260rpx;
}
}
}
</style>
@@ -0,0 +1,89 @@
<template>
<view class="contract-item-view" >
<view class="item-top-view flex-r-lr">
<text class="text-fu text-24">发起方:信任桥(深圳)网络科技有限公司</text>
<view class="right-box flex-c" :style="{
background:type?'rgba(0,167,118,0.1)':'rgba(102,102,102,0.1)'
}">
<text class="text-20 text-fu"
:class="{'text-lu':type}">{{type ? '已签署' : '未签署'}}</text>
</view>
</view>
<text class="text-36 text-zu mt-32">消费型合伙人协议</text>
<view class="flex-r-lr mt-48">
<text class="text-fu text-24" >{{text}}</text>
<text class="text-20 text-fu" >{{time}}</text>
</view>
<view class="flex-r-e mt-32">
<view class="item-btn-view flex-c" @click="onBtn" :class="{'b-w':type,'b-g':!type}">
<text class="text-28" :class="{'text-white':!type,'text-zi':type}">{{type ? '查看' : '去签署'}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
type:{
type:Boolean,
default:false
},
text:{
type:String,
default:''
},
time:{
type:String,
default:''
}
},
mounted(){
},
methods: {
onBtn(){
this.$emit('click');
}
}
}
</script>
<style lang="scss" scoped>
.b-w{
border-width: 1rpx !important;
}
.b-g{
background:linear-gradient( 270deg, #B164FB 0%, #7934F6 100%);
}
.contract-item-view{
width:100%;
min-height:304rpx;
display: flex;
flex-direction: column;
padding: 24rpx;
box-sizing: border-box;
background-color: #fff;
border-radius: 24rpx;
.item-btn-view{
padding: 0 38rpx;
min-height:52rpx;
box-sizing: border-box;
border-radius: 26rpx;
border:0 solid #7934F6;
}
.item-top-view{
height:40rpx;
min-height:40rpx;
.right-box{
padding: 0 16rpx;
box-sizing: border-box;
border-radius: 8rpx;
background: rgba(102,102,102,0.1);
}
}
}
</style>
@@ -0,0 +1,66 @@
<template>
<view class="shop-item-view" @click="onJump">
<view class="top-img-view flex-r-lr">
<image :src="obj.url"></image>
</view>
<view class="bottom-shop-view">
<text class="text-28 text-zu text-overflow1">{{obj.title}}</text>
<text class="text-28" style="color:#FF4242">
¥{{obj.adPrice}}
<text class="text-24 text-fu text-d" style="margin-left:12rpx">
¥{{obj.price}}
</text>
</text>
</view>
</view>
</template>
<script>
export default {
props:{
obj:{
type:Object,
default:null
},
},
mounted(){
},
methods: {
onJump(){
this.$emit('click');
}
}
}
</script>
<style lang="scss" scoped>
.shop-item-view{
width:332rpx;
height:498rpx;
min-height:498rpx;
display: flex;
flex-direction: column;
border-radius: 24rpx;
overflow: hidden;
background-color: #fff;
.bottom-shop-view{
width:100%;
padding: 16rpx 24rpx 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
.top-img-view{
width:332rpx;
height:332rpx;
min-height:332rpx;
image{
width:100%;
height:100%;
}
}
}
</style>
+260
View File
@@ -0,0 +1,260 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header :isMid="true" borderWidth="1rpx" >
<template v-slot:mid>
<view class="top-view">
<view class="top-box-view flex-c" :style="{
background:topSelect == index ? '#7934F6' : 'rgba(0,0,0,0)'
}"
v-for="(item,index) in topList" :key="index" @click="onTop(index)">
<text class="text-28 " :style="{
color:topSelect == index ? '#fff' : '#333'
}">{{item}}</text>
</view>
</view>
</template>
</Header>
<view class="contract-view">
<view class="tu-view" id="chart" v-if="topSelect == 0"></view>
<view class="bottom-panel" v-if="topSelect == 0">
<view class="flex-col mt-24" style="width:50%" v-for="(item,index) in data" :key="item">
<view class="flex-r">
<view class="yuan" :style="{background:dataColor[index]}"></view>
<text class="text-28 text-zu" style="margin-left:10rpx">{{item.name}}</text>
</view>
<text class="text-24 text-fu" style="margin-top:12rpx">
总营收分红占比:
<text :style="{color:dataColor[index]}">{{item.value}}%</text>
</text>
</view>
</view>
<view class="tu-view" id="chartTwo" v-if="topSelect == 1"></view>
<view class="bottom-panel" v-if="topSelect == 1">
<view class="flex-col mt-24" style="width:50%" v-for="(item,index) in dataTwo" :key="item">
<view class="flex-r">
<view class="yuan" :style="{background:dataTwoColor[index]}"></view>
<text class="text-28 text-zu" style="margin-left:10rpx">{{item.name}}</text>
</view>
<text class="text-24 text-fu" style="margin-top:12rpx">
占比:
<text :style="{color:dataTwoColor[index]}">{{item.value}}%</text>
</text>
</view>
</view>
</view>
</view>
</template>
<script>
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import * as echarts from 'echarts'
import func from '@/utils/func.js';
export default {
components: { Header,TopSafe },
data() {
return {
topSelect:0,
topList:[
'股权架构','营收数据'
],
myChart:null,
myChartTwo:null,
data: [
{ value: '51', name: '股东' },
{ value: '29', name: '推广' },
{ value: '10', name: '团队' },
{ value: '10', name: '基金会' },
],
dataColor:['#FC5E05', '#BC52FD', '#FCC139', '#0474E0'],
dataTwo:[
{ value: '25', name: '成本' },
{ value: '15', name: '分红' },
{ value: '13', name: '销售增值税' },
{ value: '12', name: '市场激励' },
{ value: '10.5', name: '年终分红' },
{ value: '10', name: 'RWA市值管理' },
{ value: '5', name: '股标护盘' },
{ value: '5', name: '交易激励' },
{ value: '4.5', name: '年终分红' },
],
dataTwoColor:['#FF8400','#6136FF', '#19CEB3', '#F1B900', '#AE9BF5'
,'#94F7A1','#006EFF','#FF2440','#00A776'],
};
},
onReady(){
// this.initTwo();
},
onLoad() {
setTimeout(()=>{
this.init()
},500)
},
methods: {
onTop(index){
if(this.topSelect !== index){
this.topSelect = index;
if(index == 0){
setTimeout(()=>{
this.init()
},500)
}else{
setTimeout(()=>{
this.initTwo()
},500)
}
}
},
init(){
let chartDom = document.getElementById('chart');
this.myChart = echarts.init(chartDom);
const option = {
color: this.dataColor,
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
// legend: {
// top: '5%',
// left: 'center'
// },
label:{
formatter: ' {d}% '
},
series: [
{
name: '股权架构',
type: 'pie',
radius: '50%',
// avoidLabelOverlap: false,
// label: {
// show: false,
// position: 'center'
// },
// emphasis: {
// label: {
// show: true,
// fontSize: 24,
// fontWeight: 'bold'
// }
// },
// labelLine: {
// show: false
// },
data: this.data
}
]
};
this.myChart.setOption(option);
},
initTwo(){
let chartDomTwo = document.getElementById('chartTwo');
this.myChartTwo = echarts.init(chartDomTwo);
const option = {
color: this.dataTwoColor,
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
// legend: {
// top: '0',
// left: 'center'
// },
label:{
formatter: '{d}%'
},
series: [
{
name: '营收数据',
type: 'pie',
radius: '50%',
// avoidLabelOverlap: false,
// selectedMode: 'single',
// label: {
// show: false,
// position: 'center'
// },
// emphasis: {
// label: {
// show: true,
// fontSize: 24,
// fontWeight: 'bold'
// }
// },
// labelLine: {
// show: false
// },
data: this.dataTwo
}
]
};
this.myChartTwo.setOption(option);
}
}
}
</script>
<style lang="scss" scoped>
.top-view{
display: flex;
justify-content: space-between;
align-items: center;
height:72rpx;
background-color: #eee;
border-radius: 36rpx;
.top-box-view{
padding: 0 32rpx;
box-sizing: border-box;
height:100%;
border-radius: 36rpx;
}
}
.contract-view{
width:100%;
height:calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
background-color: #fff;
position: relative;
.tu-view{
margin:32rpx 0;
display: flex;
width:100%;
min-height:calc(100vw - 64rpx);
}
.bottom-panel{
display: flex;
width:100%;
border-radius: 24rpx;
box-shadow: 0rpx 0rpx 29rpx 0rpx #E5E5E5;
flex-wrap: wrap;
justify-content: space-between;
padding: 24rpx;
box-sizing: border-box;
.yuan{
border-radius: 50%;
width:28rpx;
min-height:28rpx;
}
}
}
</style>
+215
View File
@@ -0,0 +1,215 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="我的合同" />
<view class="contract-view">
<ContractItem :type="type" :text="obj && obj.signatureName" :time="obj && obj.time" class="mt-24" @click="onBtn">
</ContractItem>
</view>
<u-modal :show="tipsShow" :showCancelButton="true" confirmText="去认证" @cancel="onTipsCancel" @confirm="onConfirm"
confirmColor="#7934F6" title="提示" content='签署合同需要进行实名认证,请先完成实名认证'></u-modal>
<DownPopup :show="downShow" @ok="onSignContract" @cancel="onCancel" />
<up-toast ref="uToastRef"></up-toast>
<!-- 腾讯电子签H5 → 集成到UniApp -->
<web-view v-if="signUrl" :src="signUrl" @message="handleMessage"></web-view>
</view>
</template>
<script>
import { getUserInfo } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import ContractItem from './components/contract-item.vue'
import DownPopup from '@/components/common/down-popup.vue';
import { getContractList, isSignContract, } from '@/api/contract.js'
import { getSignUrl, getMiniProgramSignUrl, signContract } from '@/api/order.js';
import func from '@/utils/func.js';
export default {
components: { Header, TopSafe, ContractItem, DownPopup },
data() {
return {
type: false,
obj: null,
flowId: null,
signUrl: null,
downShow: false,
tipsShow: false,
userInfo: null
};
},
onShow() {
},
onLoad() {
this.init();
this.userinfo();
},
methods: {
init() {
this.isSignContract()
},
userinfo() {
getUserInfo().then(res => {
if (res.bizcode == 100) {
this.userInfo = res.data;
}
console.log('res', res)
})
},
onConfirm() {
this.onTipsCancel();
uni.navigateTo({
url: '/pages/mine_package/mine_authentication/mine_authentication'
})
},
onTipsCancel() {
this.tipsShow = false;
},
onCancel() {
this.downShow = false;
},
isSignContract() {
isSignContract().then(res => {
if (res.bizcode == 100) {
this.type = res.data;
if (this.type) {
this.getSignContract()
}
} else {
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
}
})
},
getSignContract() {
getContractList().then(res => {
if (res.bizcode == 100 && res.data.length) {
this.obj = res.data[0];
this.obj.time = func.formatDate(new Date(res.data[0].signatureTime), 3)
} else {
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
}
})
},
onBtn() {
if (this.type) {
//查看
uni.navigateTo({
url: `/pages/rwa_package/dongjian/check`
})
} else {
//去签署
this.downShow = true;
}
},
// 发起合同签章
async onSignContract() {
if (this.userInfo.certStatus == 0) {
this.downShow = false;
this.tipsShow = true;
return;
} else if (this.userInfo.certStatus == 1) {
this.downShow = false;
this.$refs.uToastRef.show({
type: 'success',
message: '请耐心等待审核通过',
});
return;
}
const { bizcode, data } = await signContract();
if (bizcode === 100) {
this.flowId = data.flowId;
if (this.flowId)
// #ifdef APP-PLUS || WEB
this.onGetSignUrl(this.flowId);
// #endif
// #ifdef MP-WEIXIN
// 小程序
this.onGetMiniProgramSignUrl(this.flowId)
// #endif
}
},
// 获取H5签署链接
async onGetSignUrl(flowId) {
const params = {
// 需要的参数
flowId: flowId,
}
const { bizcode, data } = await getSignUrl(params);
if (bizcode === 100) {
this.downShow = false;
this.signUrl = data.flowApproverUrlInfos[0].longUrl;
} else {
this.$refs.uToastRef.show({
type: 'error',
message: "获取签署链接失败,请稍后再试",
});
return null;
}
},
// 获取跳转至腾讯电子签小程序的签署链接
async onGetMiniProgramSignUrl(flowId) {
const params = {
flowId: flowId,
endPoint: 'HTTP_SHORT_URL'
}
const { bizcode, data } = await getMiniProgramSignUrl(params);
if (bizcode === 100) {
console.log("跳转至腾讯电子签小程序的签署链接", data);
this.openTencentESign(data.schemeUrl);
} else {
this.$refs.uToastRef.show({
type: 'error',
message: "获取签署链接失败,请稍后再试",
});
return null;
}
},
// 电子签的回调地址
handleMessage(e) {
const data = e.detail;
console.log('电子签的回调地址', e);
},
// 小程序签名
openTencentESign(signPath) {
// 这个链接需要后端调用腾讯电子签 API 获取
uni.navigateToMiniProgram({
appId: 'wxa023b292fd19d41d', // 腾讯电子签官方小程序的 appId
path: signPath, // 跳转到的页面路径 + 参数
extraData: {}, // 如果需要传额外参数
envVersion: 'release', // 小程序版本 release / trial / develop
success(res) {
console.log('跳转成功', res)
},
fail(err) {
console.error('跳转失败', err)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.contract-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
}
</style>
+233
View File
@@ -0,0 +1,233 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="加速次数" />
<view class="contract-view">
<image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/mine-purse/jia_bg.png" class="jia-img">
</image>
<view class="box-panel" style="margin-top:384rpx">
<view class="box-top flex-r-lr" style="margin-bottom:48rpx;">
<view class="flex-c-lr" v-for="(item, index) in tList" :key="index" style="align-items: center;width:40%;">
<text class="text-48 text-zu1 text-bold">{{ item.text }}</text>
<text class="text-28 text-zu1">{{ item.value }}</text>
</view>
</view>
<view class="box-list flex-r-lr" style="align-items: center;" v-for="(item, index) in topList" :key="item.text">
<text class="text-28 text-zu1">{{ item.text }}</text>
<text class="text-32 text-bold text-zu1">{{ item.value }}</text>
</view>
<text class="text-zu txt-28 mt-24">加速明细</text>
<view class="mt-12 table-view">
<view class="table-head ">
<view class="head-box flex-c" :class="{ 'border-lr': index == 1 }" v-for="(item, index) in tableHead"
:key="index">
<text class="text-20 text-zu1">{{ item }}</text>
</view>
</view>
<view class="table-list" v-for="(item, index) in tableList" :key="index">
<view class="list-box flex-c" v-for="(key, indexT) in 3" :key="indexT"
:style="{ 'border-bottom-right-radius': index == tableList.length - 1 && indexT == 2 ? '16rpx' : 0 }" :class="{
'border-lr': indexT != 1,
'border-left-1': index == tableList.length - 1 && indexT == 0
}">
<text class="text-20 text-zu text-bold" v-if="indexT == 0">{{ item.one }}</text>
<text class="text-20 text-zu text-bold" v-if="indexT == 1">{{ item.two }}</text>
<text class="text-20 text-zu text-bold" v-if="indexT == 2">{{ item.three }}</text>
</view>
</view>
</view>
</view>
<view class="box-panel mt-32 mb-32">
<text class="text-zu text-32">加速说明</text>
<text class="text-zu1 text-28 mt-24">获取方式: </text>
<text class="text-zu1 text-28">(1)通过购买报单区和好物区商品的直推和间推奖励获得</text>
<text class="text-zu1 text-28">(2)转盘抽奖获得</text>
<text class="text-zu1 text-28 mt-24">逻辑说明: </text>
<text class="text-zu1 text-28">(1)通过内购购买商品获得的是抽奖次数,并不能直接用于抽奖,能够抽奖的次数需要每天进行释放,或者直推间推下线的奖励获得可抽奖的次数</text>
<text class="text-zu1 text-28">(2)当可抽奖次数大于抽奖次数时,可抽奖次数将会被冻结24个小时,内购商品解冻,否则冻结的抽奖次数会消失。最终解释权归商城所有!!!</text>
</view>
<!-- (2)转盘抽奖获得 -->
</view>
<!-- <DownPopup :show="true"></DownPopup> -->
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import { getUserInfo } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import DownPopup from '@/components/common/down-popup.vue';
import { quickens } from '@/api/contract.js'
import func from '@/utils/func.js';
export default {
components: { Header, TopSafe, DownPopup },
data() {
return {
tList: [
{ text: '100', value: '锁仓TBC' },
{ text: '100', value: '剩余加速包' }
],
topList: [
{ text: '已获得加速包次数', value: '100' },
{ text: '已释放TBC数量', value: '20000' },
{ text: '剩余未使用加速包次数', value: '200' },
],
tableHead: ['加速比例', '释放TBC数量', '时间'],
tableList: [
]
};
},
onLoad() {
this.init();
},
methods: {
init() {
// this.isSignContract()
this.getQuichens()
},
getQuichens() {
quickens().then(res => {
if (res.bizcode == 100) {
// this.type = res.data;
this.tList[0].text = res.data.vcoinsLock;
this.tList[1].text = res.data.quickenBalance;
this.topList[0].value = res.data.quickenTotal;
this.topList[1].value = res.data.quickenValue;
this.topList[2].value = res.data.quickenBalance;
this.tableList = res.data.quickenDetail;
this.tableList.forEach(item => {
item.one = item.quickenRate * 100 + '%';
item.two = item.quickenValue;
item.three = func.formatDate(new Date(item.ctdate), 3)
})
} else {
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
}
})
},
onBtn() {
if (this.type) {
//查看
uni.navigateTo({
url: `/pages/rwa_package/dongjian/check`
})
} else {
//去签署
}
}
}
}
</script>
<style lang="scss" scoped>
.contract-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
background: linear-gradient(315deg, #AF39C4 0%, #7732FF 100%);
position: relative;
.jia-img {
width: 724rpx;
height: 400rpx;
position: absolute;
z-index: 0;
margin-top: calc(var(--status-bar-height) + 52rpx);
}
.box-panel {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
padding: 50rpx 32rpx;
width: 690rpx;
border-radius: 36rpx;
background-color: #fff;
box-sizing: border-box;
.box-top {
width: 100%;
height: 86rpx;
min-height: 86rpx;
}
.box-list {
width: 100%;
min-height: 84rpx;
border-bottom: 1rpx solid #ececec;
}
.table-view {
width: 100%;
display: flex;
flex-direction: column;
border-radius: 16rpx;
overflow: hidden;
.table-list {
width: 100%;
height: 64rpx;
min-height: 64rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
border-bottom: 1rpx solid #EAEAEA;
.list-box {
flex: 1;
height: 100%;
box-sizing: border-box;
}
}
.table-head {
width: 100%;
height: 80rpx;
min-height: 80rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
.head-box {
flex: 1;
height: 100%;
background-color: #FAF8FE;
box-sizing: border-box;
}
}
}
.border-lr {
border-left: 1rpx solid #EAEAEA;
border-right: 1rpx solid #EAEAEA;
}
.border-left-1 {
border-bottom-left-radius: 16rpx;
}
}
}
</style>
+238
View File
@@ -0,0 +1,238 @@
<template>
<view class="content">
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
<view class="search-view">
<view class="head-view">
<u-icon size="30rpx" name="arrow-left" @click="onBack" color="#333"></u-icon>
<input class="input-view wx-width" v-model="searchInput"></input>
<!-- <u-input class="input-view wx-width"
v-model="searchInput"></u-input> -->
<view class="search-btn flex-c" @click="onSearch">
<text class="text-32 text-zu">搜索</text>
</view>
</view>
<view class="top-view mt-24">
<view class="flex-r-lr">
<text class="text-32 text-bold text-zu">搜索历史</text>
<u-icon size="40rpx" name="trash" @click="isDel = !isDel" color="#333"></u-icon>
</view>
<view class="history-view" v-if="historyList.length">
<view class="history-box flex-c mt-24 mr-32" v-for="(item,index) in historyList" :key="item">
<text class="text-24 text-fu line-h" @click="onText(item)" >{{item}}</text>
<u-icon size="32rpx" class="close-pos" v-if="isDel" @click="onDel(index)"
name="close-circle" color="#333"></u-icon>
</view>
</view>
<view class="history-on-data flex-c" v-else>
<text class="text-40 text-bold">暂无历史记录</text>
</view>
</view>
<view class="bottom-view">
<view class="bottom-head">
<text class="text-32 text-bold text-zu">商品展示</text>
</view>
<view class="bottom-scroll" v-if="dataList.length">
<ShopItem :obj="item" class="mt-24" @click="onJump(item)"
v-for="(item,index) in dataList" :key="item.id"></ShopItem>
</view>
<view class="bottom-scroll-no " v-else>
<text class="text-48 text-bold" style="margin-top:200rpx">暂无数据</text>
</view>
</view>
</view>
<DownPopup></DownPopup>
</view>
</template>
<script>
import { getUserInfo } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import DownPopup from '@/components/common/down-popup.vue';
import { searchList } from '@/api/product.js'
import ShopItem from './components/shop-item.vue'
import func from '@/utils/func.js';
export default {
components: { Header,TopSafe,DownPopup,ShopItem },
data() {
return {
searchInput:'',
historyList:[],
isDel:false,
dataList:[],
};
},
onShow() {
this.init();
},
methods: {
init(){
// this.isSignContract()
// this.getSignContract()
let arr = uni.getStorageSync('history') || '';
if(arr){
this.historyList = arr.split(',');
}else{
this.historyList = [];
}
},
onJump(item){
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id='+item.id,
})
},
onBack(){
uni.navigateBack();
},
onSearch(){
if(!this.searchInput){
return;
}
this.onAdd();
let params = {
keyword:this.searchInput
}
searchList(params).then((res)=>{
this.dataList = res.data;
console.log('res',res)
})
},
onDel(index){
this.historyList.splice(index,1);
this.onSave()
},
onAdd(){
if(this.searchInput){
let bool = false;
this.historyList.forEach(item=>{
if(item == this.searchInput){
bool = true;
}
})
if(!bool){
this.historyList.unshift(this.searchInput);
if(this.historyList.length > 15){
this.historyList.pop();
}
this.onSave();
}
}
},
onText(item){
this.searchInput = item;
},
onSave(){
if(this.historyList.length){
uni.setStorageSync('history',this.historyList.join(','));
}else{
uni.setStorageSync('history','');
}
}
}
}
</script>
<style lang="scss" scoped>
.search-view{
width:100%;
height:calc(100% - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
.top-view{
width:100%;
min-height:300rpx;
display: flex;
flex-direction: column;
padding: 0 32rpx;
box-sizing: border-box;
overflow-y: auto;
.history-on-data{
width:100%;
height:100%;
}
.history-view{
width:100%;
display: flex;
flex-wrap: wrap;
.history-box{
position: relative;
padding: 8rpx 12rpx;
box-sizing: border-box;
background-color: #fff;
border-radius: 8rpx;
.close-pos{
right:-20rpx;
position: absolute;
top:-40%;
}
}
}
}
.bottom-view{
width:100%;
flex:1;
display: flex;
flex-direction: column;
padding: 0 32rpx;
box-sizing: border-box;
.bottom-head{
height:50rpx;
display: flex;
}
.bottom-scroll{
width:100%;
height:calc(100vh - 50rpx - 324rpx - 4rpx - 88rpx - var(--status-bar-height));
overflow-y: auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.bottom-scroll-no{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
}
}
.head-view{
width:100%;
height:88rpx;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
.search-btn{
width:120rpx;
}
.input-view{
height:72rpx;
box-sizing: border-box;
padding: 0 30rpx !important;
border-radius: 36rpx;
margin-left:12rpx;
flex:1;
border:1rpx solid #7934F6;
}
/* #ifdef MP-WEIXIN */
.wx-width{
width:350rpx !important;
flex:none;
}
/* #endif */
}
}
</style>