添加:员工支持生成推广二维码
This commit is contained in:
parent
b7e853a34d
commit
ecd96a69bb
|
|
@ -0,0 +1,19 @@
|
|||
import request from "@/utils/request.js";
|
||||
|
||||
// 商户中心 - 推广二维码
|
||||
export function promoteQrCodes(data) {
|
||||
return request.get('merchant/promote_qr_code',data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue