添加:员工支持生成推广二维码

This commit is contained in:
wuhui_zzw 2024-01-23 12:01:05 +08:00
parent b7e853a34d
commit ecd96a69bb
2 changed files with 87 additions and 7 deletions

19
api/merchant.js Normal file
View File

@ -0,0 +1,19 @@
import request from "@/utils/request.js";
// 商户中心 - 推广二维码
export function promoteQrCodes(data) {
return request.get('merchant/promote_qr_code',data);
}

View File

@ -19,12 +19,22 @@
<emptyPage v-else title="暂无任何操作权限~"></emptyPage>
<shopList ref="shopList" @changeStoreClose="changeClose" @getService="getService" :is_sys='is_sys'></shopList>
<!--二维码-->
<uni-popup ref="qrCodePopup" type="center">
<view class="qr-code-content">
<image class="image" :src="qrCode"></image>
<view class="close-qr-code" @click="closeQrCode()">关闭</view>
</view>
</uni-popup>
</view>
</template>
<script>
import emptyPage from '@/components/emptyPage.vue'
import shopList from '@/components/shopList';
import {promoteQrCodes} from "@/api/merchant";
export default {
name: 'business',
components: {
@ -37,6 +47,8 @@ import emptyPage from '@/components/emptyPage.vue'
downStatus: false,
service: null,
storeList: {},
//
qrCode: '',
}
},
computed: {
@ -87,6 +99,15 @@ import emptyPage from '@/components/emptyPage.vue'
icon: 'iconfont icon-kehu-xuanzhong'
});
}
if(this.service.qr_code_show){
list.push({
type: 'qr_code',
title: '推广二维码',
url: '',
icon: 'iconfont icon-erweima1'
});
}
return list;
}
},
@ -113,16 +134,19 @@ import emptyPage from '@/components/emptyPage.vue'
this.downStatus = false;
},
goNext(item){
if(item.type == 'customer' && this.service.status == 0){
return this.$util.Tips({
title: '客服已离线,请开启客服状态!'
});
}else{
if(item.type == 'qr_code' && this.service.qr_code_show == 1){
this.createQrCode();
}
else if(item.type == 'customer' && this.service.status == 0){
return this.$util.Tips({
title: '客服已离线,请开启客服状态!'
});
}
else{
uni.navigateTo({
url: item.url,
});
}
},
getService: function(data) {
this.storeList = this.$refs.shopList.storeList || {};
@ -137,7 +161,25 @@ import emptyPage from '@/components/emptyPage.vue'
title: (!data.mer_id) ? '平台管理' : '商家管理'
})
}
}
},
// 广 -
createQrCode(){
let _this = this;
promoteQrCodes({ mer_id: _this.service.mer_id }).then(res => {
if (res.status == 200) {
_this.qrCode = res.data.qr_code || '';
_this.$refs.qrCodePopup.open('center');
}
}).catch(err => {
this.$util.Tips({
title: err
});
});
},
// 广 -
closeQrCode(){
this.$refs.qrCodePopup.close();
},
}
}
</script>
@ -217,4 +259,23 @@ import emptyPage from '@/components/emptyPage.vue'
border: 1px solid #2291F8 !important;
background-color: #2291F8 !important
}
//
.qr-code-content{
width: 80vw;
.image{
width: 80vw;
height: 80vw;
}
.close-qr-code{
position: fixed;
top: 35rpx;
right: 70rpx;
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
height: 40rpx;
line-height: 36rpx;
padding: 0 20rpx;
border-radius: 50rpx;
}
}
</style>