This commit is contained in:
weipengfei 2024-02-02 13:48:45 +08:00
parent e8a78e457d
commit 02c54ad684
5 changed files with 165 additions and 5 deletions

View File

@ -216,6 +216,15 @@ export function getRefundOrderList(where, merId) {
login: true login: true
}); });
} }
/**
* 店铺拉新二维码
* @returns {*}
*/
export function getMerNewQRcode(where, merId) {
return request.get(`server/${merId}/qrcode`, where, {
login: true
});
}
/** /**
* 营业额统计 * 营业额统计
* @returns {*} * @returns {*}

View File

@ -2,8 +2,8 @@
"name" : "惠农商户平台", "name" : "惠农商户平台",
"appid" : "__UNI__1EE148C", "appid" : "__UNI__1EE148C",
"description" : "", "description" : "",
"versionName" : "1.1.4", "versionName" : "1.1.5",
"versionCode" : 114, "versionCode" : 115,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -243,6 +243,12 @@
</image> </image>
<text class="text">补货订单</text> <text class="text">补货订单</text>
</view> </view>
<view v-if="no_prod" class="examine" @click="showQRcode">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image>
<text class="text">活动邀请码</text>
</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">
@ -327,6 +333,12 @@
</image> </image>
<text class="text">商户设置</text> <text class="text">商户设置</text>
</view> </view>
<view v-if="no_prod" class="examine" @click="showQRcode">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image>
<text class="text">活动邀请码</text>
</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}`)">
@ -397,6 +409,13 @@
</image> </image>
<text class="text">押金缴纳</text> <text class="text">押金缴纳</text>
</view> </view>
<view v-if="no_prod" class="examine" @click="showQRcode">
<image class="icon_img" src="@/static/images/index22.png" mode="aspectFit">
</image>
<text class="text">活动邀请码</text>
</view>
</view> </view>
</view> </view>
@ -553,6 +572,20 @@
</form> </form>
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="QRcodeRef">
<view class="new_qr_code">
<view style="height: 30rpx;"></view>
<image class="n_qr_head" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/34b13202402021017176584.png"></image>
<view class="n_qr_body">
<image class="n_qr_bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c5898202402021024586923.png"></image>
<image class="n_qr_code" :src="qrcodeURL"></image>
</view>
<view class="n_qr_btn">
<button class="btn1" @click="closeQRcode">取消</button>
<button class="btn2" @click="saveImageToLocal">保存</button>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -585,6 +618,9 @@ import {
merchant, merchant,
paymerchant paymerchant
} from '@/api/api.js' } from '@/api/api.js'
import {
getMerNewQRcode
} from "@/api/admin.js"
import { ENV } from "@/config/app.js" import { ENV } from "@/config/app.js"
export default { export default {
components: { components: {
@ -595,6 +631,7 @@ export default {
data () { data () {
return { return {
no_prod: false, no_prod: false,
qrcodeURL: '',
company: '', company: '',
organization_code: '', organization_code: '',
locationArr: ({}), locationArr: ({}),
@ -604,6 +641,9 @@ export default {
userInfoData: { userInfoData: {
mer_info: { mer_info: {
type_id: 0 type_id: 0
},
service:{
mer_id: 0
} }
}, },
prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/', prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/',
@ -732,6 +772,35 @@ export default {
this.isFshow = false this.isFshow = false
} }
}, },
//
showQRcode(){
this.$refs.QRcodeRef.open();
getMerNewQRcode({}, this.userInfoData.service.mer_id).then(res=>{
this.qrcodeURL = res.data.url;
})
},
//
saveImageToLocal() {
uni.saveImageToPhotosAlbum({
filePath: this.qrcodeURL,
success: ()=> {
uni.showToast({
title: '图片保存成功'
});
this.closeQRcode()
},
fail: ()=> {
console.log(err);
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
},
closeQRcode(){
this.$refs.QRcodeRef.close();
},
logout () { logout () {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
@ -1536,4 +1605,61 @@ export default {
} }
} }
} }
.new_qr_code{
background-color: #fff;
border-radius: 24rpx;
position: relative;
.n_qr_head{
width: 378rpx;
height: 96rpx;
position: absolute;
top: -32rpx;
left: 50%;
transform: translate(-50%);
}
.n_qr_body{
height: 650rpx;
width: 650rpx;
position: relative;
.n_qr_bg{
width: 600rpx;
height: 600rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.n_qr_code{
width: 480rpx;
height: 480rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
}
.n_qr_btn{
display: flex;
padding: 0 80rpx 30rpx 80rpx;
justify-content: space-between;
.btn1{
background-color: #eee;
padding: 20rpx 60rpx;
border-radius: 60rpx;
font-size: 28rpx;
color: #666;
}
.btn2{
background-color: #f75335;
padding: 20rpx 60rpx;
border-radius: 60rpx;
font-size: 28rpx;
color: #fff;
}
}
}
</style> </style>

View File

@ -1,6 +1,9 @@
<template> <template>
<view> <view>
<view class="order-index" ref="container"> <view class="order-index" ref="container">
<view class="search">
<u-search :showAction="true" searchIcon="scan" actionText="搜索" v-model="keyword" :animation="true" :actionStyle="{color: '#fff'}" @search="keywordSearch" @custom="keywordSearch" :clearabled="false" @clickIcon="scanQRcodes"></u-search>
</view>
<view class="header"> <view class="header">
<div class="header_count"> <div class="header_count">
<swiper indicator-dots="true" :circular="circular" indicator-color="#E4E4E4" <swiper indicator-dots="true" :circular="circular" indicator-color="#E4E4E4"
@ -278,7 +281,8 @@
current: "", current: "",
where: { where: {
page: 1, page: 1,
limit: 20 limit: 20,
keyword: ''
}, },
menuList: [], // menuList: [], //
menuCList: [], // menuCList: [], //
@ -316,6 +320,7 @@
id: '', id: '',
mer_labels: '' mer_labels: ''
}, // }, //
keyword: ''
} }
}, },
onLoad(options) { onLoad(options) {
@ -358,6 +363,22 @@
console.log(res) console.log(res)
}) })
}, },
//
keywordSearch(){
this.loaded = false;
this.where.keyword = this.keyword;
this.getList(this.mer_id, true);
},
//
scanQRcodes(){
uni.scanCode({
scanType: ['barCode'],
success:(res)=>{
this.keyword = res.result;
this.keywordSearch();
}
})
},
// //
initLable(){ initLable(){
labelLst({ labelLst({
@ -668,7 +689,6 @@
} }
}, },
getList: function(mer_id, ispage) { getList: function(mer_id, ispage) {
console.log('调用');
var that = this; var that = this;
if (that.loading || that.loaded) return; if (that.loading || that.loaded) return;
that.loading = true; that.loading = true;
@ -932,7 +952,7 @@
} }
.header { .header {
padding-top: 40rpx; padding-top: 30rpx;
margin: 0 20rpx; margin: 0 20rpx;
.header_count { .header_count {
@ -1311,4 +1331,9 @@
} }
} }
} }
.search{
width: 710rpx;
margin: 0 auto;
padding-top: 30rpx;
}
</style> </style>

BIN
static/images/index22.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB