This commit is contained in:
weipengfei 2024-02-05 17:50:08 +08:00
parent 71defb6b5e
commit c85dc6501d
6 changed files with 251 additions and 9 deletions

View File

@ -261,4 +261,4 @@ export function spuTopList(data) {
return request.get(`product/spu/get_hot_ranking`, data, { return request.get(`product/spu/get_hot_ranking`, data, {
noAuth: true noAuth: true
}); });
} }

View File

@ -225,6 +225,15 @@ export function getMerNewQRcode(where, merId) {
login: true login: true
}); });
} }
/**
* 商户拉新记录
*/
export function pullNewUserRecord(where, merId) {
return request.get(`server/${merId}/record`, where, {
noAuth: true
});
}
/** /**
* 营业额统计 * 营业额统计
* @returns {*} * @returns {*}

View File

@ -9,8 +9,8 @@ let httpApiThree
let wsApi let wsApi
// 在打包之前请检查当前环境是否正确 // 在打包之前请检查当前环境是否正确
// const env = 'dev'; // 开发 const env = 'dev'; // 开发
const env = 'prod'; // 生产 // const env = 'prod'; // 生产
// const env = 'prew'; // 预上线 // const env = 'prew'; // 预上线
switch (env) { switch (env) {

View File

@ -277,6 +277,15 @@
"navigationBarTitleText" : "选择地址", "navigationBarTitleText" : "选择地址",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/activeCode/activeCode",
"style" :
{
"navigationBarTitleText" : "推广二维码",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
} }
], ],
"subPackages": [{ "subPackages": [{

View File

@ -0,0 +1,224 @@
<template>
<view class="" style="position: relative;">
<view class="bg">
<image mode="widthFix" style="width: 100%;"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/home_img/shop_new_qr_code.webp"></image>
<view class="qr">
<image mode="widthFix" style="width: 500rpx;height: 500rpx;" :src="qrcodeURL"></image>
<view class="btn" @click="saveImageToLocal"><uni-icons type="download" size="30rpx" color="#fff"></uni-icons></view>
</view>
</view>
<image @click="back" class="bg_back"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image>
<view class="bg_title">推广二维码</view>
<view class="title_box">
<image mode="widthFix" style="width: 750rpx;" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/5cd59202402041637007576.png"></image>
<view class="a_title">邀请记录</view>
</view>
<view class="tables">
<view class="tab_head">
<view class="tab_item1">用户名称</view>
<view class="tab_item2">ID</view>
<view class="tab_item3">消费金额</view>
<view class="tab_item4">推广劳务费</view>
</view>
<block v-if="list.length>0">
<view class="tab_td" v-for="(item, index) in list" :key="index">
<view class="tab_item1">{{item.nickname}}</view>
<view class="tab_item2">{{item.uid}}</view>
<view class="tab_item3">{{item.order_amount}}</view>
<view class="tab_item4">{{item.commission}}</view>
</view>
</block>
<view class="tab_td" v-else>
<view style="text-align: center;width: 100%;">还没有邀请到人呢~</view>
</view>
</view>
</view>
</template>
<script>
import {
getMerNewQRcode,
pullNewUserRecord
} from "@/api/admin.js"
export default {
data() {
return {
userInfoData: {
service: {
mer_id: ''
}
},
qrcodeURL: '',
list: [],
where: {
page: 1,
limit: 20
},
isLoad: false
}
},
onLoad() {
if (typeof this.$store.state.app.userInfo == 'string') this.userInfoData = JSON.parse(this.$store.state.app
.userInfo);
else this.userInfoData = this.$store.state.app.userInfo;
this.getMerNewQRcode();
this.pullNewUserRecord();
},
onShow() {},
onReachBottom() {
if(!this.isLoad){
this.where.page++;
this.pullNewUserRecord();
}
},
methods: {
back() {
uni.navigateBack();
},
getMerNewQRcode() {
getMerNewQRcode({}, this.userInfoData.service.mer_id).then(res => {
this.qrcodeURL = res.data.url;
})
},
pullNewUserRecord(){
pullNewUserRecord(this.where, this.userInfoData.service.mer_id).then(res=>{
if(res.data.list<this.where.limit) this.isLoad = true;
this.list = [...this.list, ...res.data.list];
})
},
//
saveImageToLocal() {
uni.saveImageToPhotosAlbum({
filePath: this.qrcodeURL,
success: ()=> {
uni.showToast({
title: '图片保存成功'
});
this.closeQRcode()
},
fail: ()=> {
console.log(err);
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
},
}
}
</script>
<style lang="scss">
.bg {
width: 750rpx;
height: 952rpx;
position: relative;
.qr {
width: 500rpx;
padding-top: 230rpx;
// background-color: #eee;
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%);
.btn {
width: 415rpx;
height: 83rpx;
background: #F75335;
box-shadow: 0rpx 4rpx 20rpx 0rpx #FF5435;
color: #fff;
font-size: 30rpx;
border-radius: 83rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 30rpx auto;
}
}
}
.bg_back {
height: 34rpx;
width: 20rpx;
position: absolute;
top: calc(var(--status-bar-height) + 30rpx);
left: 30rpx;
}
.bg_title{
font-size: 32rpx;
color: #fff;
font-weight: 500;
position: absolute;
top: calc(var(--status-bar-height) + 30rpx);
left: 50%;
transform: translate(-50%);
}
.title_box{
position: relative;
margin-top: 30rpx;
.a_title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-60%);
color: #4D0C00;
font-size: 28rpx;
}
}
.tables{
width: 694rpx;
margin: 0 auto;
.tab_item1{
width: 150rpx;
}
.tab_item2{
width: 150rpx;
}
.tab_item3{
width: 190rpx;
}
.tab_item4{
width: 190rpx;
}
.tab_head{
display: flex;
justify-content: space-between;
background-color: #FFD8D1;
text-align: center;
padding: 15rpx 0;
border-radius: 10rpx;
color: #4D0C00;
font-size: 28rpx;
margin-bottom: 12rpx;
margin-top: 16rpx;
}
.tab_td{
display: flex;
justify-content: space-between;
background-color: #FFEEEB;
text-align: center;
padding: 15rpx 0;
border-radius: 10rpx;
color: #4D0C00;
font-size: 26rpx;
margin-bottom: 12rpx;
view{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tab_item3{
color: #FA4B29;
}
.tab_item4{
color: #18CE61;
}
}
}
</style>

View File

@ -244,11 +244,11 @@
<text class="text">补货订单</text> <text class="text">补货订单</text>
</view> </view>
<!-- <view v-if="no_prod" class="examine" @click="showQRcode"> <view v-if="no_prod" class="examine" @click="navigator(`/pages/activeCode/activeCode`)">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit"> <image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image> </image>
<text class="text">活动邀请码</text> <text class="text">活动邀请码</text>
</view> --> </view>
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)"> <!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFit"> <image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFit">
@ -334,11 +334,11 @@
<text class="text">商户设置</text> <text class="text">商户设置</text>
</view> </view>
<!-- <view v-if="no_prod" class="examine" @click="showQRcode"> <view v-if="no_prod" class="examine" @click="navigator(`/pages/activeCode/activeCode`)">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit"> <image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image> </image>
<text class="text">活动邀请码</text> <text class="text">活动邀请码</text>
</view> --> </view>
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)"> <!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
@ -411,11 +411,11 @@
</view> </view>
<!-- <view v-if="no_prod" class="examine" @click="showQRcode"> <view v-if="no_prod" class="examine" @click="navigator(`/pages/activeCode/activeCode`)">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit"> <image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image> </image>
<text class="text">活动邀请码</text> <text class="text">活动邀请码</text>
</view> --> </view>
</view> </view>
</view> </view>