This commit is contained in:
唐明明
2021-10-26 09:26:03 +08:00
22 changed files with 26974 additions and 8758 deletions

View File

@@ -138,7 +138,7 @@ const keyrules = () => {
})
}
// 能量球转红包前置,获取能量球的基本信息
// 通证转红包前置,获取通证的基本信息
const accountCashs = (data) => {
return request({
url: 'user/account/cashs',

View File

@@ -82,7 +82,7 @@ const withdrawsIndexLists = (data) => {
})
}
// 能量碎片记录
// 积分记录
const userAccoutScores = (data) => {
return request({
url: 'user/account/scores',
@@ -91,7 +91,7 @@ const withdrawsIndexLists = (data) => {
})
}
// 能量球转红包前置
// 通证转红包前置
const cashsCreate = () => {
return request({
url: 'user/account/cashs/create',
@@ -99,7 +99,7 @@ const withdrawsIndexLists = (data) => {
})
}
// 能量球转红包
// 通证转红包
const accountCashs = (data) => {
return request({
url: 'user/account/cashs',

View File

@@ -2,7 +2,7 @@
<view>
<block v-if="list.length > 0">
<view class="record--item" v-for="(item, index) in list" :key="index" v-if="item && !hash">
<view class="title ellipsis-1">{{item.rule.title}} <span> {{item.coin?' ('+item.coin+'个能量球) ':''}} </span></view>
<view class="title ellipsis-1">{{item.rule.title}} <span> {{item.coin?' ('+item.coin+'个通证) ':''}} </span></view>
<view class="time ellipsis-1">{{item.created_at || '-'}}</view>
<view class="webkit-box variation">
<view class="ellipsis" :class="item.amount<0 ? 'add': 'remove'">{{item.amount}}</view>

View File

@@ -14,31 +14,31 @@
"auth": true,
"style": {
"navigationBarTitleText": "发现更多",
"navigationStyle": "custom",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/user/index",
"name": "User",
"auth": true,
"style": {
"navigationBarTitleText": "节点中心",
"navigationStyle":"custom",
"navigationBarTextStyle": "white",
"app-plus":{
"titleNView": {
"type": "transparent",
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)",
"buttons": [{
"text": "\ue601",
"fontSrc":"/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
},{
"text": "\ue602",
"fontSrc":"/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
}]
}
"style": {
"navigationBarTitleText": "节点中心",
"navigationStyle":"custom",
"navigationBarTextStyle": "white",
"app-plus":{
"titleNView": {
"type": "transparent",
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)",
"buttons": [{
"text": "\ue601",
"fontSrc":"/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
},{
"text": "\ue602",
"fontSrc":"/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
}]
}
}
}
}, {
@@ -109,16 +109,16 @@
"path": "pages/goods/management",
"name": "goodsManagement",
"style": {
"navigationBarTitleText": "商品权证管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "商品权证管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
@@ -143,32 +143,32 @@
"path": "pages/coupons/management",
"name": "couponsManagement",
"style": {
"navigationBarTitleText": "优惠券管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "创建",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "优惠券管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "创建",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
"path": "pages/coupons/add",
"name": "couponsAdd",
"style": {
"navigationBarTitleText": "创建优惠券",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "创建优惠券",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
@@ -242,9 +242,9 @@
"path": "pages/wallet/property",
"name": "walletProperty",
"style": {
"navigationBarTitleText": "能量钱包",
"navigationBarTitleText": "通证钱包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor":"#976dff"
}
}, {
@@ -253,7 +253,7 @@
"style": {
"navigationBarTitleText": "现金红包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor":"#976dff"
}
},
@@ -261,7 +261,7 @@
"path": "pages/wallet/extract",
"name": "Extract",
"style": {
"navigationBarTitleText": "提现能量",
"navigationBarTitleText": "提现通证",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#976dff",
"navigationBarTextStyle": "white"
@@ -295,16 +295,16 @@
"name": "shopLists",
"auth": true,
"style": {
"navigationBarTitleText": "门店管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "门店管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
@@ -312,23 +312,23 @@
"name": "shopCreate",
"auth": true,
"style": {
"navigationBarTitleText": "创建门店"
"navigationBarTitleText": "创建门店"
}
}, {
"path": "pages/employees/list",
"name": "employeesList",
"auth": true,
"style": {
"navigationBarTitleText": "员工管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "员工管理",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
@@ -336,16 +336,16 @@
"name": "employeesAdd",
"auth": true,
"style": {
"navigationBarTitleText": "添加员工",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "添加员工",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
@@ -360,23 +360,23 @@
"name": "instrumentBasics",
"auth": true,
"style": {
"navigationBarTitleText": "基础信息",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
"navigationBarTitleText": "基础信息",
"app-plus":{
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color":"#8b64fd"
}]
}
}
}
}, {
"path": "pages/wallet/fragment",
"name": "Fragment",
"style": {
"navigationBarTitleText": "能量碎片记录",
"navigationBarTitleText": "积分记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
@@ -422,9 +422,9 @@
}
],
"globalStyle": {
"backgroundColor": "#F5F5F5",
"navigationBarBackgroundColor":"#FFFFFF",
"navigationBarTextStyle":"black"
"backgroundColor": "#F5F5F5",
"navigationBarBackgroundColor":"#FFFFFF",
"navigationBarTextStyle":"black"
},
"tabBar": {
"borderStyle": "white",
@@ -434,7 +434,7 @@
"spacing": "0",
"height": "60px",
"list": [{
"text": "发现能量",
"text": "发现通证",
"iconPath": "static/tabBar/tabBar_icon_00.png",
"selectedIconPath": "static/tabBar/tabBar_show_00.png",
"pagePath": "pages/index/index"
@@ -453,4 +453,4 @@
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
}
}

View File

@@ -9,7 +9,7 @@
签到成功
</view>
<view class="signPop-cont-text">
能量碎片<view class="signPop-cont-number">+{{sign.signSuccess}}</view>
积分<view class="signPop-cont-number">+{{sign.signSuccess}}</view>
</view>
</view>
</view>
@@ -17,7 +17,7 @@
<!-- 签到 -->
<view class="signCont">
<view class="content-title">发现更多</view>
<view class="content-sumite">海量能量碎片等你解锁</view>
<view class="content-sumite">海量积分等你解锁</view>
<view class="sign">
<view class="sign-list" :class="{ active: item.sign }" v-for="(item, index) in sign.signArr"
:key="index">
@@ -39,25 +39,25 @@
</view>
</view>
</view>
<view class="sign-record">再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}能量碎片</view>
<view class="sign-record">再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}积分</view>
</view>
<view class="signBtn">
<block v-if="sign.signCan">
<view class="signBtn-go" @click="signClick" style="cursor:pointer">
<u-icon name="calendar-fill" color="#333" size="40" />
签到领取能量碎片
签到领取积分
</view>
</block>
<block v-else>
<view class="signBtn-go" @click="$Router.push({name:'Fragment'})">
能量碎片记录<image class="signBtn-go-icon" src="/static/user/sign_arrow.png" mode="aspectFill"></image>
积分记录<image class="signBtn-go-icon" src="/static/user/sign_arrow.png" mode="aspectFill"></image>
</view>
</block>
</view>
<!-- 水晶任务 -->
<view class="task">
<view class="task-liest">
能量碎片任务
积分任务
</view>
<block v-for="(item, index) in task" :key="index">
<view class="task-item" v-if="item.rule.name != 'sign_crystal'"
@@ -144,10 +144,10 @@
})
},
// 能量碎片提示信息
// 积分提示信息
showHelp() {
uni.showModal({
title: '能量碎片',
title: '积分',
confirmColor: '#8b64fd',
content: this.energyShard.description,
showCancel: false

View File

@@ -77,8 +77,8 @@
};
},
created() {
console.log(this.$Route.query)
if(this.$Route.query.edit == 'true'){
console.log(typeof this.$Route.query.edit)
if(this.$Route.query.edit === 'true' || this.$Route.query.edit ){
managesGoodsExtends(this.$Route.query.id).then(res => {
this.productedAt = res.producted_at
this.expiriedAt = res.expiried_at
@@ -97,6 +97,7 @@
methods: {
// picker选择
pickerChange(e, key){
console.log(key,e.detail.value)
this[key] = e.detail.value
},
// 图片预览
@@ -126,7 +127,7 @@
uni.showToast({
title: err.message,
icon : 'none'
})
})
})
}
})

View File

@@ -19,7 +19,7 @@
<button class="button-item" size="mini" @click="openLay(goods.value, 'goodsMint')">增发</button>
</block>
<block v-if="status == '1'">
<button class="button-item" size="mini" @click="goodsAuth(goods.value.goods_id)">认证</button>
<button class="button-item" size="mini" @click="goodsAuth(goods.value.goods_id)"> 认证</button>
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block>
<block v-if="status == '2'">
@@ -101,14 +101,15 @@
cancelText : '确定',
success : res => {
if(res.confirm){
this.$Router.push({name: 'GoodsMagAdd', params: {type: 'edit', id}})
console.log(res.confirm)
this.$Router.push({name: 'goodsAdd', params: {type: 'edit', id}})
}
}
})
},
// 商品认证
goodsAuth(id){
this.$Router.push({name: 'goodsAuth', params: {id, type: 'magList'}})
this.$Router.push({name: 'goodsAddAuth', params: {id, type: 'magList'}})
},
// 燃烧,增发
openLay(item, type){
@@ -217,6 +218,9 @@
.tabs{
position: fixed;
top: 0;
//#ifdef H5
top: 90rpx;
// #endif
left: 0;
right: 0;
z-index: 99;

File diff suppressed because it is too large Load Diff

View File

@@ -1,237 +1,325 @@
<template>
<view class="content">
<view class="codeContent">
<view class="codeTop">
<image class="codeTop-cover" :src="companyInfo.cover" mode="aspectFill"></image>
<view class="codeTop-title">
<view class="codeTop-name">
{{companyInfo.name}}
</view>
<view class="codeTop-tips">
邀请你 加入链商星球
</view>
</view>
</view>
<view class="codeCode">
<image class="codeImg-code" :src="companyInfo.code" mode="aspectFill"></image>
<!-- 先默认死数据 -->
<!-- <image class="codeImg-code" src="/static/user/wallet-code.png" mode="aspectFill"></image> -->
<view class="codeImg-text">
长按二维码进行保存
</view>
</view>
</view>
<!-- <canvas class="codeImg" canvas-id="qrcodeCard"></canvas> -->
</view>
<view class="shareContent">
<view class="codeContent" v-if="!posterShow" @click="coverCode">
<view class="codeTop">
<image class="codeTop-cover" :src="companyInfo.cover" mode="aspectFill"></image>
<view class="codeTop-title">
<view class="codeTop-name">{{companyInfo.name}}</view>
<view class="codeTop-tips">邀请你 加入链商星球</view>
</view>
</view>
<view class="codeCode">
<image class="codeImg-code" :src="companyInfo.code" mode="aspectFill"></image>
<view class="codeImg-text">点击二维码进行保存</view>
</view>
</view>
<!-- 分享二维码 -->
<canvas class="my-canvas" canvas-id="myCanvass" id="myCanvass" />
<view v-if="posterShow">
<view class="posterBack"></view>
<view class="poster">
<view class="poster-img">
<image class="img" :src="posterImg" mode="widthFix" />
</view>
<view class="poster-btn">
<view class="operate operate-cancel" @click="saveImage">保存图片至相册</view>
<view class="operate" @tap="posterShow = false">取消</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { companiesCode } from '@/apis/interfaces/store'
export default {
data() {
return {
companyInfo : ''
}
},
created() {
companiesCode().then(res=>{
console.log(res.code)
this.companyInfo = res
})
},
methods: {
// 绘制图片
shareCanvas(e){
uni.showLoading({
title: '加载中',
})
// 下载头像
let avatarImg = new Promise(success=>{
uni.getImageInfo({
src : this.companyInfo.cover,
success : res => {
success(res.path)
}
})
})
// 下载二维码
let codeImg = new Promise(success => {
uni.getImageInfo({
src : this.companyInfo.code,
success : res => {
success(res.path)
}
})
})
Promise.all([avatarImg, codeImg]).then(res => {
// 绘制海报
const ctx = uni.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景图片
ctx.drawImage('../../static/icons/store_downBack', 0, 0, 375, 603)
// 绘制头像
ctx.drawImage(res[0], 0, 0, 60, 60)
// 绘制二维码
ctx.drawImage(res[1], 140, 250, 110, 110)
// 文字
ctx.setFontSize(16)
ctx.fillText(this.companyInfo.name, 194, 180 , 270)
ctx.setFontSize(16)
ctx.fillText('邀请你加入易货平台', 194, 180 , 270)
ctx.save();
ctx.beginPath(); //开始绘制
ctx.arc(50 / 2 + 170, 50 / 2 + 110, 50 / 2, 0, Math.PI * 2, false);
ctx.clip();
// 保存图片
ctx.draw(true, () => {
uni.hideLoading()
uni.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: res => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success : res=>{
if (res.errMsg == "saveImageToPhotosAlbum:ok"){
uni.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
}else{
uni.hideLoading()
}
},
fail : err=>{
if (err.errMsg == "saveImageToPhotosAlbum:fail auth deny"){
uni.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : res=>{
if (res.confirm){
uni.openSetting()
}
}
})
}
}
})
}
})
})
}).catch(err=>{
uni.showToast({
title: '海报下载,请检查网络',
icon : 'none'
})
})
}
}
}
import {
companiesCode
} from '@/apis/interfaces/store'
import {
saveImageToPhotosAlbum,
showToast,
downloadFile
} from '@/uni_modules/sakura-canvas/js_sdk/util'
import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
let draw = null
export default {
data() {
return {
companyInfo: {},
posterShow: false, // 是否显示下载弹窗页面
}
},
onShow() {
companiesCode().then(res => {
this.companyInfo = res
})
},
methods: {
// 生成海报
async coverCode() {
let img = this.companyInfo.code
let name = this.companyInfo.name
let avatar = this.companyInfo.cover
draw = new Draw({
width: 375,
height: 460,
canvasId: 'myCanvass',
_this: this,
background: {
type: 'color',
color: 'white',
w: 375,
h: 460,
},
})
let res = await draw.createdSharePoster(({
bgObj
}) => {
let {
width,
height
} = bgObj
this.Popinvite = bgObj
// 绘制内容
return [
// 用户昵称
{
type: 'text',
x: 120,
y: 80,
zIndex: 99,
w: width - (20 * 2),
text: name,
color: '#333',
font: {
size: 20
}
},
// 描述
{
type: 'text',
x: 120,
y: 110,
zIndex: 99,
w: width - (20 * 2),
text:'邀请你 加入链商星球',
color: '#999',
font: {
size: 16
}
},
// 用户头像
{
type: 'image',
x: 24,
y: 60,
src: avatar,
w: 80,
h: 80,
drawType: 'arc',
zIndex: 99,
borderWidth: 5, // 图片边框大小 默认0
borderColor: '#cacaca' // 图片边框颜色 默认无颜色
},
// 二维码
{
type: 'image',
x: 80,
y: 190,
w: 200,
h: 200,
zIndex: 99,
src: img,
borderWidth: 5, // 图片边框大小 默认0
borderColor: '#cacaca' // 图片边框颜色 默认无颜色
}
]
})
if (!res.success) return
this.posterImg = res.data
this.posterShow = true
},
// 保存图片
async saveImage() {
let {
posterImg
} = this
let res = await saveImageToPhotosAlbum(posterImg)
if (!res.success) return
showToast('保存成功,去相册分享给朋友吧')
this.posterShow = false
}
}
}
</script>
<style lang="scss" scoped>
.content {
background: #7c52fc;
height: 100vh;
width: 100vw;
}
.codeContent {
position: relative;
left: 0;
right: 0;
top: 0;
.codeTop {
position: absolute;
left: 5%;
top: 240rpx;
width: 90%;
background-color: #FFFFFF;
border-radius: 30rpx;
padding: 0 50rpx;
box-sizing: border-box;
box-shadow: 0 0 40rpx rgba(94,59,201,.5);
z-index: 2;
display: flex;
height: 200rpx;
.codeTop-cover {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
margin: 40rpx 30rpx 0 0;
border: 4rpx solid #FFFFFF;
box-shadow: 0 5rpx 10rpx rgba(94,59,201,.3);
}
.codeTop-title {
padding-top: 50rpx;
.codeTop-name {
font-weight: 600;
font-size: 36rpx;
margin-bottom: 10rpx;
}
.codeTop-tips {
color: $text-gray-m;
}
}
}
.codeCode {
background-color: #FFFFFF;
box-shadow: 0 0 40rpx rgba(27, 0, 111,.4);
position: absolute;
padding: 400rpx 0 200rpx;
left: 10%;
top: 160rpx;
width: 80%;
border-radius: 30rpx;
z-index: 1;
text-align: center;
.codeImg-code {
width: 360rpx;
height: 360rpx;
margin: 0 0 20rpx;
border: 2px solid #f3f3f3;
padding: 30rpx;
box-sizing: border-box;
}
.codeImg-text {
font-size: 32rpx;
color: $text-color;
}
}
}
.codeBnt {
background-color: #7c52fc;
text-align: center;
border-radius: 10rpx;
line-height: 90rpx;
font-weight: 600;
font-size: $title-size;
color: #FFFFFF;
box-shadow: 2px 0 5px rgb(124, 82, 252);
position: relative;
}
/* canvas */
.codeImg {
position: absolute;
left: -1000%;
height: 603px;
width: 375px;
background: white;
}
.shareContent {
background: #7c52fc;
height: 100vh;
width: 100vw;
}
.codeContent {
position: relative;
left: 0;
right: 0;
top: 0;
.codeTop {
position: absolute;
left: 5%;
top: 240rpx;
width: 90%;
background-color: #FFFFFF;
border-radius: 30rpx;
padding: 0 50rpx;
box-sizing: border-box;
box-shadow: 0 0 40rpx rgba(94, 59, 201, .5);
z-index: 2;
display: flex;
height: 200rpx;
.codeTop-cover {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
margin: 40rpx 30rpx 0 0;
border: 4rpx solid #FFFFFF;
box-shadow: 0 5rpx 10rpx rgba(94, 59, 201, .3);
}
.codeTop-title {
padding-top: 50rpx;
.codeTop-name {
font-weight: 600;
font-size: 36rpx;
margin-bottom: 10rpx;
}
.codeTop-tips {
color: $text-gray-m;
}
}
}
.codeCode {
background-color: #FFFFFF;
box-shadow: 0 0 40rpx rgba(27, 0, 111, .4);
position: absolute;
padding: 400rpx 0 200rpx;
left: 10%;
top: 160rpx;
width: 80%;
border-radius: 30rpx;
z-index: 1;
text-align: center;
.codeImg-code {
width: 360rpx;
height: 360rpx;
margin: 0 0 20rpx;
border: 2px solid #f3f3f3;
padding: 30rpx;
box-sizing: border-box;
}
.codeImg-text {
font-size: 32rpx;
color: $text-color;
position: relative;
z-index: 1;
}
}
}
.codeBnt {
background-color: #7c52fc;
text-align: center;
border-radius: 10rpx;
line-height: 90rpx;
font-weight: 600;
font-size: $title-size;
color: #FFFFFF;
box-shadow: 2px 0 5px rgb(124, 82, 252);
position: relative;
}
/* canvas */
.codeImg {
position: absolute;
left: -1000%;
height: 603px;
width: 375px;
background: white;
}
// canvas
.my-canvas {
width: 375px;
height: 667px;
position: fixed;
top: -99999999999rpx;
left: -99999999999rpx;
z-index: -99999999999;
opacity: 0;
}
.posterBack {
width: 100%;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, .7);
left: 0;
top: 0;
}
.poster {
width: 100vw;
height: 100vh;
display: flex;
flex-flow: column nowrap;
justify-content: center;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 999999999999;
&-img {
width: 580rpx;
position: relative;
margin: 70rpx auto 20rpx;
.img {
width: 100%;
}
}
&-btn {
padding: 0 $padding * 2;
.operate {
width: 80%;
margin-bottom: 20rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
margin-left: 10%;
display: inline-block;
text-align: center;
color: #fff;
&-cancel {
background-color: $text-price;
}
}
}
}
</style>

View File

@@ -31,25 +31,17 @@
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view>
<view class="module-imgs">
<view
class="item"
v-for="(item, index) in module.content.image"
:key="index"
>
<image
class="cover"
:src="item.showpath"
mode="aspectFill"
<view class="item" v-for="(item, index) in module.content.image" :key="index">
<image class="cover" :src="item.showpath" mode="aspectFill"
@click="openImg(module.content.image, index, 'imgs')"
@longpress="removeImg('imgs', moduleIndex, index)"
/>
@longpress="removeImg('imgs', moduleIndex, index)" />
<view class="item-input">
<input type="text" v-model="item.title" placeholder="输入标题" />
</view>
</view>
<view class="item" @click="updImgs(moduleIndex)">
<view class="item-upd cover">
<uni-icons type="plus" size="20" color="#999"/>
<uni-icons type="plus" size="20" color="#999" />
<view>上传图片</view>
</view>
</view>
@@ -64,118 +56,123 @@
<view class="module-videos">
<view class="item">
<block v-if="module.content.video_image.showpath != ''">
<image
class="cover"
:src="module.content.video_image.showpath"
mode="aspectFill"
<image class="cover" :src="module.content.video_image.showpath" mode="aspectFill"
@click="openImg([module.content.video_image.showpath], 0, 'videos')"
@longpress="removeImg('videoCover', moduleIndex, '')"
/>
@longpress="removeImg('videoCover', moduleIndex, '')" />
</block>
<block v-else>
<view class="item-upd" @click="updImg('videoCover', moduleIndex)">
<uni-icons type="plus" size="20" color="#999"/>
<uni-icons type="plus" size="20" color="#999" />
<view>上传视频封面</view>
</view>
</block>
</view>
<view class="item">
<video
class="cover"
v-if="module.content.video_url.showpath != ''"
:src="module.content.video_url.showpath"
@longpress="removeImg('video', moduleIndex, '')"
/>
<video class="cover" v-if="module.content.video_url.showpath != ''"
:src="module.content.video_url.showpath" @longpress="removeImg('video', moduleIndex, '')" />
<view class="item-upd" @click="updImg('video', moduleIndex)" v-else>
<uni-icons type="plus" size="20" color="#999"/>
<uni-icons type="plus" size="20" color="#999" />
<view>上传视频</view>
</view>
</view>
</view>
<view class="module-hint">点击查看封面/视频长按删除封面/视频</view>
<view class="module-hint">点击查看封面/视频长按删除封面
<span class='delVideo' v-if="module.content.video_url.showpath != ''"
@longpress="removeImg('video', moduleIndex, '')">长按删除视频</span>
</view>
</view>
</block>
<view @click="addModule" class="add-modules"><uni-icons class="icon" color="#8b64fd" size="20" type="plus"></uni-icons>添加模块</view>
<view @click="addModule" class="add-modules">
<uni-icons class="icon" color="#8b64fd" size="20" type="plus"></uni-icons>添加模块
</view>
</view>
</template>
<script>
import { basicsInfo, basicsConfig } from '@/apis/interfaces/store'
import { uploads } from '@/apis/interfaces/uploading'
import {
basicsInfo,
basicsConfig
} from '@/apis/interfaces/store'
import {
uploads
} from '@/apis/interfaces/uploading'
export default {
data() {
return {
logo : '',
description : '',
address : '',
modules : [],
modulesType : []
logo: '',
description: '',
address: '',
modules: [],
modulesType: []
};
},
created() {
Promise.all([basicsInfo('GET', {}), basicsConfig()]).then(res => {
let info = res[0]
this.logo = info.base.cover
let info = res[0]
this.logo = info.base.cover
this.description = info.base.description
this.modules = info.extends
this.address = info.info.address
this.modules = info.extends
this.address = info.info.address
this.modulesType = res[1]
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
},
onNavigationBarButtonTap(){
onNavigationBarButtonTap() {
this.onBasicsInfo()
},
methods:{
methods: {
// 图片预览
openImg(paths, index, type){
if(type === 'imgs'){
openImg(paths, index, type) {
if (type === 'imgs') {
paths = paths.map(val => {
return val.showpath
})
}
uni.previewImage({
urls : paths,
current : index,
urls: paths,
current: index,
indicator: 'number'
})
},
// 删除图片
removeImg(type, moduleIndex, index){
removeImg(type, moduleIndex, index) {
let modulesObj = this.modules[moduleIndex]
if(type === 'videoCover'){
if (type === 'videoCover') {
modulesObj.content.video_image.showpath = ''
modulesObj.content.video_image.path = ''
}
if(type === 'imgs'){
if (type === 'imgs') {
modulesObj.content.image.splice(index, 1)
}
if(type === 'video'){
if (type === 'video') {
modulesObj.content.video_url.showpath = ''
modulesObj.content.video_url.path = ''
}
this.$set(this.modules, moduleIndex, modulesObj)
},
// 单图上传
updImg(type, index){
switch(type){
updImg(type, index) {
switch (type) {
case 'logo':
uni.chooseImage({
crop: {width: 300, height: 300},
success: path=> {
crop: {
width: 300,
height: 300
},
success: path => {
uploads([{
name: 'logo',
uri : path.tempFilePaths[0]
uri: path.tempFilePaths[0]
}]).then(res => {
this.logo = res.url[0]
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
}
@@ -183,11 +180,14 @@
break
case 'videoCover':
uni.chooseImage({
crop: {width: 500, height: 350},
success: path=> {
crop: {
width: 500,
height: 350
},
success: path => {
uploads([{
name: 'logo',
uri : path.tempFilePaths[0]
uri: path.tempFilePaths[0]
}]).then(res => {
let modulesObj = this.modules[index]
modulesObj.content.video_image.showpath = res.url[0]
@@ -196,7 +196,7 @@
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
}
@@ -204,10 +204,10 @@
break
case 'video':
uni.chooseVideo({
success: path=> {
success: path => {
uploads([{
name: 'video',
uri : path.tempFilePath
uri: path.tempFilePath
}]).then(res => {
let modulesObj = this.modules[index]
modulesObj.content.video_url.showpath = res.url[0]
@@ -216,7 +216,7 @@
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
}
@@ -225,23 +225,23 @@
}
},
// 批量上传图片
updImgs(index){
updImgs(index) {
uni.chooseImage({
success: res=>{
success: res => {
let path = res.tempFiles.map((val, index) => {
return {
name: 'uploads' + index,
uri : val.path
uri: val.path
}
})
uploads(path).then(pathRes => {
let modulesObj = this.modules[index],
paths = []
for(let i in pathRes.path){
paths = []
for (let i in pathRes.path) {
paths.push({
showpath: pathRes.url[i],
path : pathRes.path[i],
title : ''
path: pathRes.path[i],
title: ''
})
}
modulesObj.content.image = [...modulesObj.content.image, ...paths]
@@ -249,23 +249,23 @@
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
}
})
},
// 添加展示模块
addModule(){
addModule() {
let modulesList = this.modulesType.map(val => {
return val.value
})
uni.showActionSheet({
itemList: modulesList,
success : res => {
success: res => {
let content
switch(this.modulesType[res.tapIndex].id){
switch (this.modulesType[res.tapIndex].id) {
case 1:
content = {
content: ''
@@ -275,50 +275,50 @@
content = {
image: []
}
break
break
case 3:
content = {
video_image: {
showpath: '',
path : ''
path: ''
},
video_url : {
video_url: {
showpath: '',
path : ''
path: ''
}
}
break
break
}
this.modules.push({
type : this.modulesType[res.tapIndex].id,
title : '',
content : content
type: this.modulesType[res.tapIndex].id,
title: '',
content: content
})
}
})
},
// 删除展示模块
removeModule(index){
removeModule(index) {
this.modules.splice(index, 1)
},
// 保存基础信息
onBasicsInfo(){
onBasicsInfo() {
basicsInfo('PUT', {
cover : this.logo,
description : this.description,
address : this.address,
extends : this.modules
cover: this.logo,
description: this.description,
address: this.address,
extends: this.modules
}).then(res => {
uni.showModal({
title : '提示',
content : '基本信息已保存',
showCancel : false,
title: '提示',
content: '基本信息已保存',
showCancel: false,
confirmColor: '#8b64fd',
success : modalRes=> {
if(modalRes.confirm){
success: modalRes => {
if (modalRes.confirm) {
this.$Router.back()
}
}
@@ -326,7 +326,7 @@
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
}
@@ -335,17 +335,18 @@
</script>
<style lang="scss" scoped>
.basics-content{
}
.basics-content {}
// 基础信息
.info{
.info {
background: white;
padding: 0 $padding;
.item{
.item {
position: relative;
padding: $padding 0 $padding 200rpx;
&::after{
&::after {
position: absolute;
left: 0;
bottom: 0;
@@ -354,53 +355,62 @@
height: 1rpx;
background: #eee;
}
&:last-child::after{
&:last-child::after {
display: none;
}
}
.info-logo{
.info-logo {
text-align: right;
padding-right: 40rpx;
label{
label {
position: absolute;
left: 0;
height: 88rpx;
line-height: 88rpx;
}
image{
image {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
vertical-align: top;
background: $border-color-lg;
}
.icon{
.icon {
position: absolute;
right: 0;
top: 50%;
margin-top: -10px;
}
}
.info-text{
label{
.info-text {
label {
position: absolute;
left: 0;
height: 40rpx;
line-height: 40rpx;
}
textarea{
textarea {
line-height: 40rpx;
width: 100%;
height: 160rpx;
}
input{
input {
height: 40rpx;
width: 100%;
}
}
}
// 添加模块
.add-modules{
.add-modules {
margin: $margin 0;
line-height: 88rpx;
height: 88rpx;
@@ -409,70 +419,82 @@
background: white;
box-sizing: border-box;
font-size: $title-size-lg;
.icon{
.icon {
vertical-align: middle;
margin-right: $margin/3;
}
}
// 展示模块
.module-item{
.module-item {
background: white;
padding: $padding/2 $padding;
margin-top: $margin - 10;
.module-title{
.module-title {
display: flex;
justify-content: space-between;
padding-bottom: $padding/2;
border-bottom: solid 1rpx $border-color;
.title-input{
.title-input {
width: calc(100% - 150rpx);
height: 70rpx;
font-size: $title-size;
}
.remove-btn{
.remove-btn {
line-height: 70rpx;
color: $text-price;
text-align: right;
font-size: $title-size-m;
}
}
.module-textarea{
.module-textarea {
padding: $padding 0 $padding/2;
width: 100%;
font-size: $title-size;
line-height: 50rpx;
box-sizing: border-box;
textarea{
textarea {
width: 100%;
height: 200rpx;
}
}
.module-imgs{
.module-imgs {
display: flex;
flex-wrap: wrap;
padding-top: $padding/2;
margin-left: -10rpx;
margin-right: -10rpx;
.item{
.item {
position: relative;
background: #F8F8F8;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 10rpx;
.cover{
.cover {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.item-input{
.item-input {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba($color: #000000, $alpha: .7);
input{
input {
height: 50rpx;
line-height: 50rpx;
font-size: 28rpx;
@@ -481,7 +503,8 @@
color: white;
}
}
.item-upd{
.item-upd {
@extend .vertical;
text-align: center;
font-size: $title-size-m;
@@ -489,24 +512,35 @@
}
}
}
.module-hint{
.module-hint {
color: $text-gray;
font-size: $title-size-sm;
padding: $padding/2 0;
line-height: 50rpx;
.delVideo{
display: inline-block;
background-color: $mian-color;
color: #fff;
margin-left: 30rpx;
padding:2rpx 20rpx ;
}
}
.module-videos{
.module-videos {
display: flex;
padding: $padding 0 ($padding/2);
margin-left: -10rpx;
margin-right: -10rpx;
.item{
.item {
position: relative;
width: calc(50% - #{$margin/2});
padding-top: calc(35% - #{$margin/2});
background: #f8f8f8;
margin: 0 10rpx;
.item-upd{
.item-upd {
position: absolute;
top: 0;
left: 0;
@@ -518,7 +552,8 @@
line-height: 40rpx;
@extend .vertical;
}
.cover{
.cover {
position: absolute;
top: 0;
left: 0;

View File

@@ -34,7 +34,7 @@
</swiper>
</view>
<view class="footer">
<view class="hith">朋友通过你的邀请注册成功后将与您绑定好友关系通过成为平台用户你都可以获得能量碎片奖励</view>
<view class="hith">朋友通过你的邀请注册成功后将与您绑定好友关系通过成为平台用户你都可以获得积分奖励</view>
<view class="number">
<view class="title">邀请码 : {{inviteData[0].invite}}</view>
<view class="value" @click="copyCenter(inviteData[0].invite)">复制邀请码</view>

View File

@@ -71,8 +71,11 @@
<view class="userVip-rights">
<view class="userVip-rightst-title">
<view class="userVip-rightst-title-name">查看会员专属权益</view>
<view class="userVip-rightst-more"
@click="$Router.push({name: 'vipIndex', params:{identity_id: userIdentity.right.identity_id}})">
<!-- <view class="userVip-rightst-more" @click="$Router.push({name: 'vipIndex', params:{identity_id: userIdentity.right.identity_id}})">
全部更多 <image class="userVip-rightst-more-img" src="/static/user/userVip_more_arrow.png">
</image>
</view> -->
<view class="userVip-rightst-more" @click="openVip(userIdentity.right.identity_id)">
全部更多 <image class="userVip-rightst-more-img" src="/static/user/userVip_more_arrow.png">
</image>
</view>
@@ -109,7 +112,7 @@
<view class="userAssets">
<view class="userAssets-top">
<view class="withdraw-name" v-if="userData.account">
当前能量球价值<view class="withdraw-number">{{userData.account.stone_value || 0}}</view>
当前通证价值<view class="withdraw-number">{{userData.account.stone_value || 0}}</view>
</view>
<view class="withdraw-btn" @click="$Router.push({name: 'Extract'})">
去提现
@@ -121,7 +124,7 @@
</view>
<view class="assets-list" v-if="userData.account">
<view class="assets-label" @click="$Router.push({name:'walletProperty'})">
<view class="assets-label-name">能量球钱包
<view class="assets-label-name">通证钱包
<image @click.stop="showHelp('wallet')" class="assets-label-icon"
src="/static/user/userAssets_tips.png" />
</view>
@@ -135,7 +138,7 @@
<view class="assets-label-number">{{userData.account.cash || 0}}</view>
</view>
<view class="assets-label" @click="$Router.push({name:'Fragment'})">
<view class="assets-label-name">能量碎片
<view class="assets-label-name">积分
<image @click.stop="showHelp('chip')" class="assets-label-icon"
src="/static/user/userAssets_tips.png" />
</view>
@@ -380,9 +383,9 @@
},
// 友情提示信息
showHelp(type) {
let title = '能量球',
let title = '通证',
content = this.helpDoc.energy_ball.description
if (type == 'chip') title = '能量碎片'
if (type == 'chip') title = '积分'
if (type == 'chip') content = this.helpDoc.energy_shard.description
uni.showModal({
title: title,

View File

@@ -111,7 +111,7 @@
<view class="footer" >
<image class="footer-btn" v-if="identitie[tabsIndex].can.show_button && voucher === ''" :src="identitie[tabsIndex].button_cover" mode="widthFix" @click="openOrder" />
<view class="current-btn-sh" v-if="identitie[tabsIndex].can.show_button && voucher !== ''" @click="openOrder" >{{voucher.status.value === 1?'申请审核中':''}}{{voucher.status.value === 3?'申请被驳回查看原因':''}}</view>
<view class="current-btn-sh" v-if="!identitie[tabsIndex].can.show_button && voucher === ''">已开通</view>
<!-- <view class="current-btn-sh" v-if="!identitie[tabsIndex].can.show_button && voucher === ''">已开通</view> -->
<view class="ios-bottom"></view>
</view>
</view>
@@ -177,7 +177,12 @@
});
this.identitie = res.identities
if (type === 'cre') {
this.tabsIndex = res.identities.findIndex(val => val.identity_id == this.$Route.query.identity_id)
let Index = res.identities.findIndex(val => val.identity_id == this.$Route.query.identity_id)
if(Index+1 === res.identities){
this.tabsIndex = Index
}else{
this.tabsIndex = Index+1
}
}
this.openCondition = res.identities[this.tabsIndex].obj_condition
this.rights = res.identities[this.tabsIndex].rights
@@ -243,8 +248,9 @@
wechatAppPay(orderId){
vipWechatPay(orderId,{
type: 'app'
}).then(res=>{
}).then(res=>{
let payConfig = JSON.parse(res)
console.log(payConfig,'console.log(res)')
uni.requestPayment({
provider: 'wxpay',
orderInfo: {...payConfig},
@@ -254,13 +260,14 @@
content : "支付成功,已成功开通/升级节点身份",
showCancel : false,
success : ()=> {
this.idenInfo()
this.idenInfo()
}
})
},
fail: payErr => {
fail: payErr => {
console.log(payErr,'console.log(payErr)')
uni.showToast({
title: '支付已被取消',
title: '支付失败,原因:' + payErr.errMsg,
icon : 'none'
})
}

View File

@@ -1,6 +1,9 @@
<template>
<view class="selectCard">
<view class="demo" v-if="lists.length>0"><u-icon name="info-circle-fill" label-color='#cacaca' color='#cacaca' label='长按删除添加银行卡'/></view>
<view class="demo11">
<icon type="warn" color='#7c52fc' size="16"/>
长按删除添加银行卡
</view>
<view class="bankInfo" v-if="lists.length>0" v-for="(item,index) in lists" :key='index'
@longpress='delBank(item.bank_account_id,index)'>
<image class="bankLogin" @click="selectBank(item)" :src="item.bank.cover" mode="widthFix" />
@@ -123,14 +126,24 @@
},
// 选择银行返回上一页携带参数
selectBank(item) {
// let bankInfo = {
// name: item.bank.name + '-' + item.no.substring(item.no.length - 4),
// bank_account_id: item.bank_account_id
// }
// let pages = getCurrentPages()
// let prevPage = pages[pages.length - 2]
// console.log(bankInfo)
// prevPage._data.bankInfo = bankInfo
// uni.navigateBack() //返回上一页面
let bankInfo = {
name: item.bank.name + '-' + item.no.substring(item.no.length - 4),
bank_account_id: item.bank_account_id
}
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
console.log(bankInfo)
prevPage._data.bankInfo = bankInfo
// prevPage._data.bankInfo = bankInfo
prevPage.$vm.bankInfo = bankInfo;
uni.navigateBack() //返回上一页面
}
}
@@ -167,6 +180,17 @@
font-size: 26rpx;
text-align: center;
}
.demo11{
color: #7c52fc;
font-size: 26rpx;
text-align: center;
display: flex;
justify-content: center;
// background-color: #e93340;
icon{
margin-right: 10rpx;
}
}
.bankInfo {
width: calc(100% - 60rpx);
background-image: linear-gradient(to right, #7c52fc, #976dff);

View File

@@ -3,7 +3,7 @@
<view class="propery">
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
<view class="propery-content">
<view class="currency">能量球钱包
<view class="currency">通证钱包
<span>( {{ cost || '0.00' }} CNY)</span>
</view>
<view class="balance">{{ balance || '0.00' }}</view>
@@ -38,12 +38,12 @@
export default {
data() {
return {
balance: 0, // 钱包能量球数量
balance: 0, // 钱包通证数量
tax: 0, // 当前手续费
cost: 1, // 每个能量球的价格
cost: 1, // 每个通证的价格
total: 0, // 约合人民币
card: '', // 银行卡号
withdraw_input: '', // 提现能量球数量
withdraw_input: '', // 提现通证数量
bank_accounts: 0,
bankInfo: {}
};
@@ -73,7 +73,7 @@
})
})
},
// 输入提现能量球数量
// 输入提现通证数量
inputNum(e) {
let number = Number(e.detail.value)
if (number <= Number(this.balance)) {
@@ -120,7 +120,7 @@
}
if (data.amount === 0) {
uni.showToast({
title: '请输入能量球数量',
title: '请输入通证数量',
icon: 'none'
})
return;

View File

@@ -44,12 +44,12 @@
export default {
data() {
return {
balance: 0, // 钱包能量球金额
balance: 0, // 钱包通证金额
tax: 0, // 当前手续费
cost: 1, // 每个能量球的价格
cost: 1, // 每个通证的价格
total: 0, // 约合人民币
card: '', // 银行卡号
withdraw_input: '', // 提现能量球金额
withdraw_input: '', // 提现通证金额
bank_accounts: 0,
bankInfo: {}
};
@@ -81,7 +81,7 @@
})
})
},
// 输入提现能量球金额
// 输入提现通证金额
inputNum(e) {
let number = Number(e.detail.value)
console.log(number, this.balance)
@@ -140,7 +140,7 @@
}
if (data.amount === 0) {
uni.showToast({
title: '请输入能量球金额',
title: '请输入通证金额',
icon: 'none'
})
return;

View File

@@ -3,7 +3,7 @@
<view class="propery">
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
<view class="propery-content">
<view class="currency">能量球钱包
<view class="currency">通证钱包
<span>( {{ price || '0.00' }} CNY)</span>
</view>
<view class="balance">{{ balance.balance || '0.00' }}</view>
@@ -11,7 +11,7 @@
<view class="balance-flex">
<view class="balance-flex-item" @click="showAddress">区块链地址</view>
<!-- <view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view> -->
<view class="balance-flex-item" @click="$Router.push({name: 'Extract'})">能量球转红包</view>
<view class="balance-flex-item" @click="$Router.push({name: 'Extract'})">通证转红包</view>
</view>
</view>
</view>

View File

@@ -11,7 +11,7 @@
</view>
<view class="record-mouth-year">
<view class="record-type-right">
<view class="record-title">当前能量球
<view class="record-title">当前通证
<view class="record-type-left">
<u-picker mode="time" v-model="show" :params="params" @confirm='confirm' title='筛选日期'
start-year='2021' :end-year='currentYear' />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long