[锶源昆仑-寺庙捐赠活动]
This commit is contained in:
281
pages/user/census.vue
Normal file
281
pages/user/census.vue
Normal file
@@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="back">
|
||||
<view class="back-title">
|
||||
锶源昆仑统计数据
|
||||
</view>
|
||||
</view>
|
||||
<view class="parade">
|
||||
<view class="dataOne">
|
||||
<view class="dataOne-item">
|
||||
<view class="dataOne-number">
|
||||
{{activities.all}}
|
||||
</view>
|
||||
<view class="dataOne-text">
|
||||
发行总量
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOne-item">
|
||||
<view class="dataOne-number">
|
||||
{{activities.donate}}
|
||||
</view>
|
||||
<view class="dataOne-text">
|
||||
已捐数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOne-item">
|
||||
<view class="dataOne-number">
|
||||
{{activities.residue}}
|
||||
</view>
|
||||
<view class="dataOne-text">
|
||||
剩余数量
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单数据 -->
|
||||
<view class="dataOther">
|
||||
<view class="dataOther-title">
|
||||
订单数据
|
||||
</view>
|
||||
<view class="dataOther-list">
|
||||
<view class="dataOther-item" @click="$router.push({name: 'CensusOrder', params: {state: 'all', newTitle: '总订单'}})">
|
||||
<view class="dataOther-number">
|
||||
{{orders.all}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
总订单数
|
||||
</view>
|
||||
<view class="dataOther-see">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item" @click="$router.push({name: 'CensusOrder', params: {state: ' PAID', newTitle: '待发货'}})">
|
||||
<view class="dataOther-number">
|
||||
{{orders.paid}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
待发货数
|
||||
</view>
|
||||
<view class="dataOther-see">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item" @click="$router.push({name: 'CensusOrder', params: {state: 'DELIVERED', newTitle: '已发货'}})">
|
||||
<view class="dataOther-number">
|
||||
{{orders.delivered}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
已发货
|
||||
</view>
|
||||
<view class="dataOther-see">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item" @click="$router.push({name: 'CensusOrder', params: {state: 'SIGNED', newTitle: '已签收'}})">
|
||||
<view class="dataOther-number">
|
||||
{{orders.signed}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
已签收
|
||||
</view>
|
||||
<view class="dataOther-see">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item" @click="$router.push({name: 'CensusUser'})">
|
||||
<view class="dataOther-number">
|
||||
{{orders.users}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
捐献人数
|
||||
</view>
|
||||
<view class="dataOther-see dataOther-red">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item">
|
||||
<view class="dataOther-number">
|
||||
{{orders.amount}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
收款总额
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 会员数据 -->
|
||||
<!-- <view class="dataOther">
|
||||
<view class="dataOther-title">
|
||||
会员数据
|
||||
</view>
|
||||
<view class="dataOther-list">
|
||||
<view class="dataOther-item">
|
||||
<view class="dataOther-number">
|
||||
{{users.all}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
注册总量
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item">
|
||||
<view class="dataOther-number">
|
||||
{{users.yk}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
月卡数
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item">
|
||||
<view class="dataOther-number">
|
||||
{{users.jk}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
季卡数
|
||||
</view>
|
||||
</view>
|
||||
<view class="dataOther-item">
|
||||
<view class="dataOther-number">
|
||||
{{users.nk}}
|
||||
</view>
|
||||
<view class="dataOther-text">
|
||||
年卡数
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { censusData } from '@/apis/interfaces/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activities: '',
|
||||
orders : '',
|
||||
users : ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
// 获取查看数据
|
||||
this.censusInfo();
|
||||
},
|
||||
|
||||
methods:{
|
||||
// 查看数据
|
||||
censusInfo() {
|
||||
censusData().then(res => {
|
||||
this.activities = res.activities
|
||||
this.orders = res.orders
|
||||
this.users = res.users
|
||||
console.log(res)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
padding-bottom: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.back {
|
||||
background-image: linear-gradient(to right, #6884fc, #868afe);
|
||||
text-align: center;
|
||||
padding: 80rpx 0 140rpx;
|
||||
.back-title {
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.parade {
|
||||
margin-top: -70rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
.dataOne {
|
||||
background-color: #ffffff;
|
||||
padding: 40rpx 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
.dataOne-item {
|
||||
flex: 3;
|
||||
text-align: center;
|
||||
.dataOne-number {
|
||||
font-size: 40rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.dataOne-text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dataOther {
|
||||
background-color: #ffffff;
|
||||
margin-top: 30rpx;
|
||||
padding: 30rpx 30rpx 0;
|
||||
.dataOther-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.dataOther-list {
|
||||
overflow: hidden;
|
||||
padding: 20rpx 0;
|
||||
margin: 0 -10rpx;
|
||||
.dataOther-item {
|
||||
background-color: #f4f7fd;
|
||||
width: calc(33.33% - 20rpx);
|
||||
margin: 0 10rpx 20rpx;
|
||||
padding: 25rpx 0;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
float: left;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.dataOther-see {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background-color: #f0bb6e;
|
||||
color: #ffffff;
|
||||
font-size: 22rpx;
|
||||
padding: 0 12rpx;
|
||||
line-height: 34rpx;
|
||||
border-radius: 0 0 0 10rpx;
|
||||
&.dataOther-red {
|
||||
background-color: #d86a6b;
|
||||
}
|
||||
}
|
||||
.dataOther-text {
|
||||
font-size: 24rpx;
|
||||
color: #383c4b;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.dataOther-number {
|
||||
color: #315cf4;
|
||||
font-weight: 600;
|
||||
font-size: 38rpx;
|
||||
text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
255
pages/user/censusOrder.vue
Normal file
255
pages/user/censusOrder.vue
Normal file
@@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="list" v-if="orderList.length > 0">
|
||||
<view class="item" v-for="(item, index) in orderList" :key="index">
|
||||
<view class="item-name">
|
||||
{{item.order_no}}
|
||||
</view>
|
||||
<view class="grey">
|
||||
<view class="label" v-if="item.state != null">
|
||||
<view class="label-name">
|
||||
订单状态
|
||||
</view>
|
||||
<view class="label-text label-color">
|
||||
{{item.state}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.name != null">
|
||||
<view class="label-name">
|
||||
收件人
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.mobile != null">
|
||||
<view class="label-name">
|
||||
手机号
|
||||
</view>
|
||||
<view class="label-text label-tel">
|
||||
<view class="label-tel-number">{{item.express.mobile}}</view>
|
||||
<view class="label-tel-dial" @click="clickCall(item.express.mobile)">拨打</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.qty != null">
|
||||
<view class="label-name">
|
||||
捐献数量
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.qty}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.total != null">
|
||||
<view class="label-name">
|
||||
捐献金额
|
||||
</view>
|
||||
<view class="label-text label-price">
|
||||
<text>¥</text>{{item.total}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.receive_at != null">
|
||||
<view class="label-name">
|
||||
签收时间
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.receive_at}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.deliver_at != null">
|
||||
<view class="label-name">
|
||||
发货时间
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.deliver_at}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.deliver_at != null">
|
||||
<view class="label-name">
|
||||
物流名称
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.express_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.express_no != null">
|
||||
<view class="label-name">
|
||||
物流编号
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.express_no}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label" v-if="item.express.full_address != null">
|
||||
<view class="label-name">
|
||||
收货地址
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.express.full_address}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" v-if="lodingStats">
|
||||
<block v-if="page.has_more">
|
||||
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block v-else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" v-else>
|
||||
<image src="/static/imgs/coupon_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dataOrder } from '@/apis/interfaces/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderList : [],
|
||||
page : {}, //分页信息
|
||||
lodingStats : false //加载状态
|
||||
};
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据-订单列表
|
||||
this.censusInfo();
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$Route.query.newTitle
|
||||
})
|
||||
},
|
||||
|
||||
methods:{
|
||||
// 查看数据-订单列表
|
||||
censusInfo(page) {
|
||||
dataOrder({
|
||||
status: this.$Route.query.state,
|
||||
page : page || 1
|
||||
}).then(res => {
|
||||
let listArr = this.orderList,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data)
|
||||
this.orderList = newData
|
||||
this.page = res.page
|
||||
this.lodingStats= false
|
||||
uni.stopPullDownRefresh()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 拨打电话
|
||||
clickCall (tel) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: tel,//电话号码
|
||||
success: res => {
|
||||
console.log(res);
|
||||
},
|
||||
fail: err =>{
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh() {
|
||||
// 数据-订单列表
|
||||
this.censusInfo();
|
||||
},
|
||||
|
||||
// 上拉加载
|
||||
onReachBottom(){
|
||||
this.lodingStats = true
|
||||
let pageNumber = this.page.current
|
||||
if(this.page.has_more){
|
||||
pageNumber++
|
||||
// 数据-订单列表
|
||||
this.censusInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.pack-center {
|
||||
z-index: 9;
|
||||
}
|
||||
.list {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
.item {
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
.item-name {
|
||||
font-weight: 600;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.grey {
|
||||
background-color: #fcfcfc;
|
||||
border-radius: 10rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
.label {
|
||||
display: flex;
|
||||
padding-bottom: 30rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
&:last-child {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.label-name {
|
||||
width: 170rpx;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
.label-text {
|
||||
width: calc(100% - 170rpx);
|
||||
text-align: justify;
|
||||
&.label-color {
|
||||
color: #6884fc;
|
||||
}
|
||||
&.label-price {
|
||||
color: red;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
.label-tel {
|
||||
display: flex;
|
||||
.label-tel-number {
|
||||
flex: 1;
|
||||
}
|
||||
.label-tel-dial {
|
||||
background-color: #edf4ff;
|
||||
color: #5370eb;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 0 15rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
214
pages/user/censusUser.vue
Normal file
214
pages/user/censusUser.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="list" v-if="orderList.length > 0">
|
||||
<view class="label" v-for="(item, index) in orderList" :key="index">
|
||||
<view class="item">
|
||||
<image class="item-head" :src="item.avatar ? item.avatar : '/static/imgs/default_myHead.png'" mode="aspectFill"></image>
|
||||
<view class="item-cont">
|
||||
<view class="item-left">
|
||||
<view class="item-top">
|
||||
{{item.nickname}}
|
||||
</view>
|
||||
<view class="item-identity">
|
||||
{{item.username}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right" @click="clickCall(item.username)">
|
||||
联系
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="see">
|
||||
<view class="see-item">
|
||||
<view class="see-name">
|
||||
捐献金额
|
||||
</view>
|
||||
<view class="see-text see-color">
|
||||
<text>¥</text>{{item.orders_sum_amount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="see-item">
|
||||
<view class="see-name">
|
||||
捐献数量
|
||||
</view>
|
||||
<view class="see-text">
|
||||
{{item.orders_count}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" v-if="lodingStats">
|
||||
<block v-if="page.has_more">
|
||||
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block v-else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" v-else>
|
||||
<image src="/static/imgs/coupon_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dataUser } from '@/apis/interfaces/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderList : [],
|
||||
page : {}, //分页信息
|
||||
lodingStats : false //加载状态
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
// 数据-订单列表
|
||||
this.censusInfo();
|
||||
},
|
||||
|
||||
methods:{
|
||||
// 查看数据-订单列表
|
||||
censusInfo(page) {
|
||||
dataUser({
|
||||
page : page || 1
|
||||
}).then(res => {
|
||||
console.log(res.data)
|
||||
let listArr = this.orderList,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data)
|
||||
this.orderList = newData
|
||||
this.page = res.page
|
||||
this.lodingStats= false
|
||||
uni.stopPullDownRefresh()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 拨打电话
|
||||
clickCall (tel) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: tel,//电话号码
|
||||
success: res => {
|
||||
console.log(res);
|
||||
},
|
||||
fail: err =>{
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh() {
|
||||
// 数据-订单列表
|
||||
this.censusInfo();
|
||||
},
|
||||
|
||||
// 上拉加载
|
||||
onReachBottom(){
|
||||
this.lodingStats = true
|
||||
let pageNumber = this.page.current
|
||||
if(this.page.has_more){
|
||||
pageNumber++
|
||||
// 数据-订单列表
|
||||
this.censusInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.list {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
.label {
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.item {
|
||||
position: relative;
|
||||
.item-head {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.item-cont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding-left: 130rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
.item-left {
|
||||
flex: 1;
|
||||
line-height: 54rpx;
|
||||
.item-top {
|
||||
font-weight: 600;
|
||||
margin-right: $margin - 10;
|
||||
}
|
||||
.item-identity {
|
||||
font-size: $title-size-m;
|
||||
color: #8282a7;
|
||||
}
|
||||
}
|
||||
.item-right {
|
||||
display: inline-block;
|
||||
font-size: $title-size-m;
|
||||
background-color: #edf4ff;
|
||||
color: #5370eb;
|
||||
height: 54rpx;
|
||||
line-height: 54rpx;
|
||||
padding: 0 $padding + 10;
|
||||
border-radius: $radius * 4;
|
||||
margin-top: $margin - 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.see {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
background-color: #f4f7fd;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 30rpx;
|
||||
.see-item {
|
||||
flex: 2;
|
||||
text-align: center;
|
||||
.see-name {
|
||||
font-size: 24rpx;
|
||||
color: #383c4b;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.see-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 10rpx;
|
||||
text {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
&.see-color {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,31 +1,83 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="While">
|
||||
<view class="codeUser" v-if="inviteData.user_info">
|
||||
<image class="codeUser-img" :src="inviteData.user_info.avatar || '/static/imgs/default_myHead.png'" mode="aspectFill"></image>
|
||||
<view class="codeUser-name">{{ inviteData.user_info.nickname }}</view>
|
||||
<view class="code">
|
||||
<image class="codeBack" :src="posterImg" mode="widthFix"></image>
|
||||
<view class="code-share" @click="shareClick">
|
||||
<image src="/static/icons/down.png"></image>
|
||||
<view class="code-share-name">保存图片</view>
|
||||
</view>
|
||||
<view class="codeImg">
|
||||
<image class="codeUser-img" :src="inviteData.code" mode="aspectFill"></image>
|
||||
<view class="codeUser-text">
|
||||
扫描二维码,注册成功后,即可绑定关系
|
||||
</view>
|
||||
|
||||
<!-- 打卡海报 -->
|
||||
<view class="postertBack" v-if="isImgLay"></view>
|
||||
<view class="postert" v-if="isImgLay">
|
||||
<view class="poster-Cont">
|
||||
<img class="poster-Cont-img" :src="posterImg">
|
||||
</view>
|
||||
<view class="sign-btn">
|
||||
<view class="remove-btn">长按图片保存</view>
|
||||
<view class="sign-img-block">
|
||||
<button class="sign-img-btn" size="mini" @click="isImgLay = false">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="While down">
|
||||
长按保存我的推广码
|
||||
</view>
|
||||
|
||||
|
||||
<!--何院士 海报canvas -->
|
||||
<!-- <vue-canvas-poster :widthPixels="1000" :painting="academician" @success="saveSuccess" @fail="saveFail" v-if="identity == 3"></vue-canvas-poster> -->
|
||||
|
||||
<!-- 海报canvas -->
|
||||
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
|
||||
<vue-canvas-poster :widthPixels="1000" :painting="paintings" @success="saveSuccess" @fail="saveFail"></vue-canvas-poster>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { invite } from '@/apis/interfaces/user'
|
||||
import { VueCanvasPoster } from 'vue-canvas-poster'
|
||||
export default {
|
||||
components: {
|
||||
VueCanvasPoster
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inviteData: ''
|
||||
inviteData: '', //用户二维码
|
||||
invitecode : '', //二维码
|
||||
identity : 1,//1为普通,2为上师版, 3为何院士
|
||||
isImgLay : false, //是否显示图片弹出层
|
||||
paintings : {
|
||||
width: "375px",
|
||||
height: "800px",
|
||||
borderRadius: "10px",
|
||||
background: "#ffffff",
|
||||
views: [
|
||||
//海报背景
|
||||
{
|
||||
type: "image",
|
||||
url: "",
|
||||
css: {
|
||||
top: "0",
|
||||
left: "0",
|
||||
width: "375px",
|
||||
height: "800px",
|
||||
mode: 'aspectFill'
|
||||
},
|
||||
},
|
||||
|
||||
//二维码
|
||||
{
|
||||
type: "image",
|
||||
url: "",
|
||||
css: {
|
||||
top: "412px",
|
||||
left: "39px",
|
||||
width: "110px",
|
||||
height: "110px",
|
||||
mode: 'aspectFill'
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
posterImg: "", //生成的海报图片路径
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -36,7 +88,12 @@
|
||||
// 推广码
|
||||
inviteInfo() {
|
||||
invite().then(res => {
|
||||
this.identity = res.user_info.tag
|
||||
this.inviteData = res
|
||||
this.invitecode = res.code
|
||||
|
||||
this.paintings.views[0].url = "/static/img/shartBack.jpg"
|
||||
this.paintings.views[1].url = res.code
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -53,143 +110,217 @@
|
||||
})
|
||||
},
|
||||
|
||||
// 绘图
|
||||
dowCode(){
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
|
||||
// 头像
|
||||
let avatarImg = new Promise(success=>{
|
||||
uni.getImageInfo({
|
||||
src : this.inviteData.user_info.avatar,
|
||||
success : res => {
|
||||
success(res.path)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 下载素材
|
||||
let codeImg = new Promise(success => {
|
||||
uni.getImageInfo({
|
||||
src : this.inviteData.code,
|
||||
success : res => {
|
||||
success(res.path)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Promise.all([avatarImg, codeImg]).then(res => {
|
||||
// 绘制海报
|
||||
const ctx = uni.createCanvasContext('qrcodeCard')
|
||||
ctx.save()
|
||||
// 下载海报
|
||||
shareClick (){
|
||||
this.paintings.views[0].url = "/static/img/shart.jpg"
|
||||
this.paintings.views[1].url = this.invitecode
|
||||
this.isImgLay = true
|
||||
|
||||
// if(this.identity == 1) {
|
||||
|
||||
// 绘制背景
|
||||
ctx.drawImage('/static/imgs/codeBack.png', 0, 0, 375, 452)
|
||||
|
||||
// 绘制头像
|
||||
ctx.drawImage(res[0], 155, 35, 70, 70)
|
||||
// 绘制二维码
|
||||
ctx.drawImage(res[1], 110, 200, 160, 160)
|
||||
// 文字
|
||||
ctx.setFontSize(16)
|
||||
ctx.setFillStyle("#FFFFFF")
|
||||
ctx.setTextAlign('center')
|
||||
ctx.fillText(this.inviteData.user_info.nickname, 190, 135 , 270)
|
||||
|
||||
// 文字
|
||||
ctx.setFontSize(15)
|
||||
ctx.setFillStyle("#919191")
|
||||
ctx.setTextAlign('center')
|
||||
ctx.fillText("扫描二维码,注册成功后,即可绑定关系",190, 400)
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath(); //开始绘制
|
||||
ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false);
|
||||
ctx.clip();
|
||||
|
||||
// 保存图片
|
||||
ctx.draw(true, () => {
|
||||
uni.hideLoading()
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'qrcodeCard',
|
||||
x: 0,
|
||||
y: 0,
|
||||
success: res => {
|
||||
this.removeSaveImg()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title: '海报下载,请检查网络',
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
// }else if(this.identity == 2) {
|
||||
// this.paintings.views[0].url = "/static/imgs/code_01.png"
|
||||
// }else {
|
||||
// this.academician.views[0].url = "/static/imgs/code_02.png"
|
||||
// this.academician.views[1].url = "/static/imgs/codeshart_back_02.png"
|
||||
// this.academician.views[2].url = this.invitecode
|
||||
// this.academician.views[3].url = "/static/imgs/codeShart_title1.png"
|
||||
// }
|
||||
|
||||
},
|
||||
saveSuccess(src) {
|
||||
this.posterImg = src;
|
||||
|
||||
},
|
||||
saveFail(err) {},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
overflow: hidden;
|
||||
background: #f3f4f6;
|
||||
padding: 140rpx 80rpx;
|
||||
.code {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: #08182f;
|
||||
.codeBack {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
.code-share {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
left: 0;
|
||||
bottom: 22%;
|
||||
background: linear-gradient(to right, #aa957b, #ffeeda);
|
||||
width: 50rpx;
|
||||
text-align: center;
|
||||
border-radius: 0 20rpx 20rpx 0;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 何院士样式 */
|
||||
.newCode-cont {
|
||||
width: 70%;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
text-align: center;
|
||||
left: 15%;
|
||||
bottom: 19.5%;
|
||||
background: linear-gradient(to top, #a09084, #a58367);
|
||||
padding: 15rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.newCode-img {
|
||||
height: 170rpx;
|
||||
margin: 0 auto;
|
||||
background: linear-gradient(to top, #e9d1bd, #c49b7a);
|
||||
border: 4rpx solid #f3c49d;
|
||||
border-radius: 30rpx;
|
||||
display: flex;
|
||||
padding: 10rpx 30rpx 10rpx 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.While {
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: .05);
|
||||
border-radius: 10rpx;
|
||||
.newCode-img-title {
|
||||
width: calc(100% - 140rpx);
|
||||
}
|
||||
|
||||
.newCode-img-title image {
|
||||
width: 80%;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.newCode-img-code {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
.code-cont {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
text-align: center;
|
||||
left: 15%;
|
||||
width: 200rpx;
|
||||
padding: 15rpx;
|
||||
top: 50%;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.code-img{
|
||||
margin-bottom: 10rpx;
|
||||
overflow: hidden;
|
||||
// border-radius: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
position: relative;
|
||||
// border: 4rpx solid #be9768;
|
||||
}
|
||||
.code-img image {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.code-code {
|
||||
color: #275979;
|
||||
font-size: $title-size-sm - 2;
|
||||
border-top: 2rpx #275979 dotted;
|
||||
padding-top: 10rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.code-text {
|
||||
background: linear-gradient(to right, #aa957b, #ffeeda, #aa957b);
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.codeUser {
|
||||
background-color: #6e79ec;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
padding: 50rpx 0;
|
||||
.codeUser-img {
|
||||
|
||||
|
||||
.code-share image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.code-share-name {
|
||||
writing-mode:vertical-rl;
|
||||
font-size: 28rpx;
|
||||
padding-left: 4rpx;
|
||||
color: #4d2a00;
|
||||
}
|
||||
|
||||
.postertBack {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
background-color: rgba(0,0,0,.6);
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 90;
|
||||
}
|
||||
.postert {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 99;
|
||||
.poster-Cont {
|
||||
width: 80vw;
|
||||
height: 80vh;
|
||||
top: 3vh;
|
||||
left: 10vw;
|
||||
position: absolute;
|
||||
background-color: #FFFFFF;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
.codeImg {
|
||||
padding: 60rpx 0;
|
||||
text-align: center;
|
||||
.codeUser-img {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
}
|
||||
.codeUser-text {
|
||||
padding: 0 100rpx;
|
||||
color: #919191;
|
||||
line-height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: $radius-m;
|
||||
.poster-Cont-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.poster-Cont-code {
|
||||
position: absolute;
|
||||
bottom: 250px;
|
||||
left: 46px;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.down {
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: #54975e;
|
||||
}
|
||||
|
||||
/* canvas */
|
||||
.canvasImg {
|
||||
.sign-btn {
|
||||
position: absolute;
|
||||
left: -1000%;
|
||||
bottom: 0;
|
||||
height: 452px;
|
||||
width: 375px;
|
||||
background: #fbf6f0;
|
||||
top: 83vh;
|
||||
width: 80%;
|
||||
left: 10%;
|
||||
z-index: 999;
|
||||
.remove-btn {
|
||||
width: 100%;
|
||||
line-height: 90rpx;
|
||||
background-color: #bf9960;
|
||||
color: #FFFFFF;
|
||||
border-radius: $radius-m;
|
||||
margin-top: $margin - 10;
|
||||
text-align: center;
|
||||
font-size: $title-size + 2;
|
||||
}
|
||||
.sign-img-block {
|
||||
display: flex;
|
||||
margin: 20rpx -10rpx 0;
|
||||
.sign-img-btn {
|
||||
flex: 2;
|
||||
line-height: 90rpx;
|
||||
background-color: #ffeeda;
|
||||
border-radius: $radius-m;
|
||||
text-align: center;
|
||||
font-size: $title-size;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
1008
pages/user/index.vue
1008
pages/user/index.vue
File diff suppressed because it is too large
Load Diff
14
pages/user/product.vue
Normal file
14
pages/user/product.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<image class="product" src="http://api.siyuankunlun.com/storage/materials/2022/09/05/productimg.jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.product {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
26
pages/user/tips.vue
Normal file
26
pages/user/tips.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="pack-center pages-hint">
|
||||
<image src="/static/img/Noevaluate.png"></image>
|
||||
<view class="point-name">敬请期待</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.point-name {
|
||||
font-size: $title-size + 4;
|
||||
margin-top: $margin;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user