This commit is contained in:
王创世 2024-06-28 08:50:34 +08:00
parent 55f7b3280b
commit 348a886a84
10 changed files with 738 additions and 365 deletions

View File

@ -178,6 +178,12 @@
"style": {
"navigationBarTitleText": "智慧云商协"
}
},
{
"path": "user/my_vip_off",
"style": {
"navigationBarTitleText": "智慧云商协"
}
}
]
}, {

View File

@ -175,7 +175,8 @@
</view>
<scroll-view :scroll-x="true" style="padding:0rpx 30rpx;white-space: nowrap;width: 100%"
v-if="actList.length>0">
<view v-for="(item,index) in actList" @click="openUrl('/pages/packageB/event/event_info?id='+item.id)"
<view v-for="(item,index) in actList"
@click="openUrl('/pages/packageB/event/event_info?id='+item.id)"
style="position: relative;;display: inline-block;width: 300rpx;text-align: center;background-color: #FFF;border-radius: 20rpx;overflow: hidden;margin-right: 20rpx;">
<view>
<image :src="apiImgUrl+item.activity_image" mode="aspectFill"
@ -212,10 +213,11 @@
activeColor="#3377FF" :current="current" name="name" @change="change" :fontSize="28"></tn-tabs>
</view>
</view>
<view style="padding:0px 28rpx;padding-bottom: 100rpx;min-height:1000rpx">
<view style="padding:0px 28rpx;padding-bottom: 50rpx;min-height:1000rpx">
<view v-for="(item,index) in news_list" :class="{ 'rounded_corner': index === 0 }"
style="background-color: #ffffff;">
<view class="tn-flex tn-flex-row-between" @click="openUrl('/pages/packageB/news/new_info?id='+item.news_id)"
<view class="tn-flex tn-flex-row-between"
@click="openUrl('/pages/packageB/news/new_info?id='+item.news_id)"
style="padding: 20rpx;min-height: 200rpx;">
<view style="margin-left: 20rpx;" v-if="item.news_image">
<image :src="apiImgUrl+item.news_image" mode="aspectFill"
@ -243,6 +245,11 @@
<tn-select :safeAreaInsetBottom="true" v-model="selectShow" mode="single" :list="selectList"
@confirm="confirm"></tn-select>
</view>
<view @click="callPhone"
style="text-align: center;padding-bottom: 100rpx;font-size: 24rpx;color: #999999;letter-spacing: 2rpx;">
<view>技术支持洛阳灵睿网络</view>
<view style="margin-top: 10rpx;">电话15503791530</view>
</view>
</view>
</template>
@ -297,6 +304,17 @@
//this.getArticlePolicyListAll();
},
methods: {
callPhone() {
uni.makePhoneCall({
phoneNumber: '15503791530', //
success: function() {
console.log('拨打电话成功');
},
fail: function() {
console.log('拨打电话失败');
}
});
},
msg() {
return this.$store.state.msgCount;
},

View File

@ -33,8 +33,8 @@
</view>
<tn-tabbar :show="tabShow" :outHeight="140" :height="120" v-model="currentIndex" :list="tabbarList"
activeColor="#3377FF" inactiveColor="#AAAAAA" activeIconColor="#3377FF" inactiveIconColor="#8A8E99"
:animation="true" :safeAreaInsetBottom="true" @change="switchTabbar"></tn-tabbar>
activeColor="#000000" inactiveColor="#AAAAAA" activeIconColor="#3377FF" inactiveIconColor="#888888"
:animation="true" :safeAreaInsetBottom="true" :thisIndex="thisIndex" @change="switchTabbar"></tn-tabbar>
</view>
</template>
@ -63,12 +63,14 @@
tabbarList: [{
title: '首页',
activeIcon: '/static/01_1.png',
inactiveIcon: '/static/01.png'
inactiveIcon: '/static/01.png',
id: 0,
},
{
title: '通讯录',
activeIcon: '/static/02_2.png',
inactiveIcon: '/static/02.png'
inactiveIcon: '/static/02.png',
id: 1,
},
// {
// //
@ -80,14 +82,17 @@
{
title: '发现',
activeIcon: '/static/03_3.png',
inactiveIcon: '/static/03.png'
inactiveIcon: '/static/03.png',
id: 2,
},
{
title: '个人中心',
activeIcon: '/static/04_4.png',
inactiveIcon: '/static/04.png'
inactiveIcon: '/static/04.png',
id: 3,
}
],
thisIndex: 0,
// tabbar
currentIndex: 0,
//
@ -192,7 +197,7 @@
_switchTabbarPage(index) {
const selectPageFlag = this.tabberPageLoadFlag[index]
this.thisIndex = this.tabbarList[index].id;
if (selectPageFlag === undefined) {
return
}

View File

@ -1,36 +1,38 @@
<template>
<view style="background-color: #EBF4F7;letter-spacing: 1rpx;min-height: 100vh;">
<tn-nav-bar :isBack="false" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view class="tn-margin-top"
style="text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'发现'}]" :current="topCurrent" activeColor="#000" :bold="false"
:fontSize="36"></tn-tabs>
<tn-nav-bar :isBack="false" :bottomShadow="false" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-center">
<view class="tn-margin-top" style="text-align: center;">
<text>发现</text>
</view>
</view>
</tn-nav-bar>
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin">
<view class="justify-content-item align-content-item" style="width: 100%;">
<view class="tn-flex tn-flex-col-center"
style="border-radius: 100rpx;padding: 10rpx 20rpx 10rpx 20rpx;width: 95%;background-color: rgba(255, 255, 255, 0.9);">
<text
class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></text>
<input v-model="content" class="justify-content-item" placeholder="请填写协会名称" name="input"
placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}"
style="background-color: #ffffff;padding-bottom: 10rpx;">
<view style="padding:0rpx 20rpx">
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin"
style="background-color: #ffffff;">
<view class="justify-content-item align-content-item" style="width: 100%;">
<view class="tn-flex tn-flex-col-center"
style="border-radius: 100rpx;padding: 15rpx 20rpx;width: 100%;background-color:#F1F2F8;">
<text
class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></text>
<input v-model="content" class="justify-content-item" placeholder="请输入协会名称进行搜索" name="input"
placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
</view>
</view>
</view>
<view>
<view class="justify-content-item tn-text-center">
<tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx"
@click="onsubmit()">
<text class="tn-color-white"> </text>
</tn-button>
</view>
<!-- <view>
<view class="justify-content-item tn-text-center">
<tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx"
@click="onsubmit()">
<text class="tn-color-white"> </text>
</tn-button>
</view>
</view> -->
</view>
</view>
<!-- <view class="tn-flex tn-flex-row-around tn-flex-center tn-flex-col-center" style="padding: 30rpx;">-->
<!-- <view style="color: #E15033;">-->
<!-- <text class="tn-icon-sequence-vertical" style="vertical-align: middle;"></text>-->
@ -58,7 +60,27 @@
<!-- <text class="tn-icon-down-triangle"></text>-->
<!-- </view>-->
<!-- </view>-->
<view style="padding:0rpx 30rpx 180rpx 30rpx;">
<view style="padding:20rpx 30rpx 180rpx 30rpx;">
<view style="position: relative;" @click="tn('/pages/index/pizz_info?id='+item.id)">
<view class="tn-flex tn-flex-center tn-flex-col-center"
style="box-shadow: 0rpx 4rpx 25rpx 0rpx rgba(5,171,129,0.25);background: linear-gradient(to bottom,rgba(19,194,150,0.7) 0%, #13C296 100%);padding:40rpx 30rpx;border-radius: 30rpx;margin-bottom: 20rpx;">
<view>
<image :src="apiImgUrl+item.association_image"
style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
</view>
<view style="margin-left: 20rpx;">
<view style="color:#ffffff;font-size: 32rpx;font-weight: 600;">洛阳市总商会
</view>
<view style="font-size: 28rpx;color: rgba(255,255,255,0.6);margin-top: 15rpx;">成立时间2021-10-01
</view>
</view>
</view>
<view
style="font-size: 20rpx;color: #09AE85;background-color: #B8EDE0;position: absolute;top: 0;right: 0;border-radius: 0px 15rpx 0px 15rpx;padding:10rpx 10rpx;">
<text class="tn-icon-success-circle-fill" style="vertical-align: middle;"></text>
<text style="vertical-align: middle;margin-left: 5rpx;">已认证</text>
</view>
</view>
<view v-for="(item,index) in list" style="position: relative;"
@click="tn('/pages/index/pizz_info?id='+item.id)">
<view class="tn-flex tn-flex-center tn-flex-col-center"

View File

@ -75,7 +75,7 @@
</view>
</view>
</view>
<view style="background-color: #fff;padding-bottom: 80rpx;">
<view style="background-color: #fff;padding-bottom: 0rpx;">
<view style="padding:0px 20rpx;">
<tn-list-cell v-if="login" :arrow="true" @click="tn('/pages/packageA/user/my_card_holder')">
<view class="tn-flex tn-flex-center tn-flex-col-center">
@ -142,7 +142,8 @@
<view style="margin-left: 20rpx;">意见反馈</view>
</view>
</tn-list-cell>
<tn-list-cell :arrow="true" @click="tn('/pages/packageA/user/my_vip')">
<tn-list-cell v-if="userInfo.if_business==1" :arrow="true"
@click="tn('/pages/packageA/user/my_vip')">
<view class="tn-flex tn-flex-center tn-flex-col-center">
<image src="/static/ico12.png" style="width: 50rpx;height: 50rpx"></image>
<view style="margin-left: 20rpx;">会员卡</view>
@ -202,7 +203,11 @@
</view>
<view style="height: 120rpx;"></view>
</tn-popup>
<view @click="callPhone"
style="text-align: center;padding-bottom: 100rpx;font-size: 24rpx;color: #999999;letter-spacing: 2rpx;padding-top: 40rpx;">
<view>技术支持洛阳灵睿网络</view>
<view style="margin-top: 10rpx;">电话15503791530</view>
</view>
</view>
</template>

View File

@ -1,172 +1,208 @@
<template>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'会员卡'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="openQrcode" fontColor="#ffffff">出示二维码</tn-button>
</view>
</view>
<tn-tabs :list="list" :isScroll="true" :activeItemStyle="{fontSize:'30rpx',fontWeight:'600'}"
activeColor="#3377FF" :current="current" name="type_name" @change="change" :fontSize="28"></tn-tabs>
<view style="padding: 30rpx;">
<view v-for="(item,index) in sp_list" style="position: relative;"
@click="tn('/pages/packageA/user/my_vip_info?id='+item.id)">
<view class="tn-flex tn-flex-col-center tn-flex-row-between"
style="background-color: #ffffff;padding:50rpx 30rpx;border-radius: 15rpx;margin-bottom: 20rpx;">
<view class="tn-flex tn-flex-col-center">
<view>
<image :src="item.business_image==''?'/static/def.png':apiImgUrl+item.business_image"
style="width: 100rpx;height: 100rpx;border-radius: 50%;">
</image>
</view>
<view style="margin-left: 20rpx;">
<view style="font-size: 31rpx;font-weight: 600;letter-spacing: 5rpx;">{{item.business_name}}
</view>
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">地址{{item.address}}</view>
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">电话{{item.telephone}}
</view>
</view>
</view>
<view style="width: 200rpx;text-align: right;">
<tn-button backgroundColor="#3377FF" size="sm" shape="round" fontColor="#ffffff">查看</tn-button>
</view>
</view>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'会员卡'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="openQrcode" fontColor="#ffffff">出示二维码</tn-button>
<view style="margin-top: 20rpx;">会员卡号{{ code }}</view>
</view>
</view>
<tn-tabs :list="list" :isScroll="true" :activeItemStyle="{fontSize:'30rpx',fontWeight:'600'}"
activeColor="#3377FF" :current="current" name="type_name" @change="change" :fontSize="28"></tn-tabs>
<view style="padding: 30rpx;">
<view v-for="(item,index) in sp_list" style="position: relative;"
@click="tn('/pages/packageA/user/my_vip_info?id='+item.id)">
<view class="tn-flex tn-flex-col-center tn-flex-row-between"
style="background-color: #ffffff;padding:50rpx 30rpx;border-radius: 15rpx;margin-bottom: 20rpx;">
<view class="tn-flex tn-flex-col-center">
<view>
<image :src="item.business_image==''?'/static/def.png':apiImgUrl+item.business_image"
style="width: 100rpx;height: 100rpx;border-radius: 50%;">
</image>
</view>
<view style="margin-left: 20rpx;">
<view style="font-size: 31rpx;font-weight: 600;letter-spacing: 5rpx;">
{{ item.business_name }}
</view>
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">地址{{ item.address }}
</view>
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">电话{{ item.telephone }}
</view>
</view>
</view>
<view style="width: 200rpx;text-align: right;">
<tn-button backgroundColor="#3377FF" size="sm" shape="round" fontColor="#ffffff">查看</tn-button>
</view>
</view>
<!-- <view
style="font-size: 20rpx;color: #43A9F8;background-color: #CAE5FF;position: absolute;top: 0;right: 0;border-radius: 0px 15rpx 0px 15rpx;padding:10rpx 10rpx;">
<text class="tn-icon-success-circle-fill" style="vertical-align: middle;"></text>
<text style="vertical-align: middle;margin-left: 5rpx;">已认证</text>
</view> -->
</view>
</view>
<tn-popup v-if="show" :closeBtn="true" v-model="show" mode="center" width="500rpx" height="600rpx">
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">核销二维码</view>
<view style="text-align: center;width: 300rpx;margin:0rpx auto;">
<l-painter ref="painter" css="background: #fff;width: 300rpx;text-align: center;">
<l-painter-qrcode :text="qrcode_url" css="width: 300rpx; height: 300rpx" />
</l-painter>
</view>
<view style="text-align: center;margin-top: 50rpx;">
<tn-button @click="show= false" shape="round" width="80%" backgroundColor="#3F8BF2"
fontColor="#ffffff">关闭</tn-button>
</view>
</tn-popup>
</view>
<!-- <view
style="font-size: 20rpx;color: #43A9F8;background-color: #CAE5FF;position: absolute;top: 0;right: 0;border-radius: 0px 15rpx 0px 15rpx;padding:10rpx 10rpx;">
<text class="tn-icon-success-circle-fill" style="vertical-align: middle;"></text>
<text style="vertical-align: middle;margin-left: 5rpx;">已认证</text>
</view> -->
</view>
</view>
<tn-popup v-if="show" :closeBtn="true" v-model="show" mode="center" width="500rpx" height="600rpx">
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">核销二维码</view>
<view style="text-align: center;width: 300rpx;margin:0rpx auto;">
<l-painter ref="painter" css="background: #fff;width: 300rpx;text-align: center;">
<l-painter-qrcode :text="qrcode_url" css="width: 300rpx; height: 300rpx"/>
</l-painter>
</view>
<view style="text-align: center;margin-top: 50rpx;">
<tn-button @click="show= false" shape="round" width="80%" backgroundColor="#3F8BF2"
fontColor="#ffffff">关闭
</tn-button>
</view>
</tn-popup>
</view>
</template>
<script>
import {
businesstypeList,
businessList
} from "@/util/api";
import store from "@/store";
export default {
data() {
return {
current: 0,
show: false,
qrcode_url: '',
list: [],
page: 1,
type: 0,
apiImgUrl: this.$store.state.imgUrl,
sp_list: []
}
},
onLoad() {
this.getbusinesstypeList();
this.getbusinessList();
},
methods: {
change(d) {
this.current = d;
var info = this.list[d];
this.type = info.id;
this.page = 1;
this.sp_list = [];
this.getbusinessList();
},
getbusinessList() {
var u = uni.getStorageSync('userInfo');
businessList({
business_type: this.type,
association_id: u.association_id,
page: this.page,
size: 10,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.sp_list.push(...res.data.list);
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getbusinesstypeList() {
businesstypeList()
.then(res => {
console.log(res);
if (res.code == 1) {
var key = res.data;
key.unshift({
id: 0,
type_name: '全部'
});
this.list = res.data;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
openQrcode() {
var u = uni.getStorageSync('userInfo');
this.qrcode_url = store.state.apiUrl + "?type=2&key=123456789-" + u.id + "-" + u.association_id + "";
setTimeout(() => {
this.show = true;
}, 500)
},
tn(e) {
uni.navigateTo({
url: e
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
import {
businesstypeList,
businessList,
handleMembercode
} from "@/util/api";
import store from "@/store";
}
},
}
}
export default {
data() {
return {
current: 0,
show: false,
qrcode_url: '',
list: [],
page: 1,
type: 0,
apiImgUrl: this.$store.state.imgUrl,
sp_list: [],
code: 0,
}
},
onLoad() {
this.getbusinesstypeList();
this.getbusinessList();
this.setHandleMembercode();
},
methods: {
change(d) {
this.current = d;
var info = this.list[d];
this.type = info.id;
this.page = 1;
this.sp_list = [];
this.getbusinessList();
},
setHandleMembercode() {
var u = uni.getStorageSync('userInfo');
handleMembercode({
member_id: u.id,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.code = res.data.member_code
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getbusinessList() {
var u = uni.getStorageSync('userInfo');
businessList({
business_type: this.type,
association_id: u.association_id,
page: this.page,
size: 10,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.sp_list.push(...res.data.list);
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getbusinesstypeList() {
businesstypeList()
.then(res => {
console.log(res);
if (res.code == 1) {
var key = res.data;
key.unshift({
id: 0,
type_name: '全部'
});
this.list = res.data;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
generateUUIDv4() {
const charts = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
var res = '';
for (var i = 0; i < 18; i++) {
var id = Math.ceil(Math.random() * 35);
res += charts[id];
}
return res;
},
openQrcode() {
var u = uni.getStorageSync('userInfo');
this.qrcode_url = store.state.imgUrl + "?type=2&key=" + this.code + "&association_id=" + u.association_id + "&random_number=" + this.generateUUIDv4();
setTimeout(() => {
this.show = true;
}, 500)
},
tn(e) {
uni.navigateTo({
url: e
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
},
}
}
</script>
<style>
page {
background-color: aliceblue;
}
page {
background-color: aliceblue;
}
</style>

View File

@ -1,168 +1,266 @@
<template>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'店员管理'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding: 30rpx;">
<view>当前店铺</view>
<view @click="select_show = true">
<text>123456</text>
<text class="tn-icon-down-triangle"></text>
</view>
</view>
<tn-select v-model="select_show" mode="single" :list="select_list"></tn-select>
<view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="addClerkShow = true" fontColor="#ffffff">添加店员</tn-button>
</view>
<view style="margin: 20rpx;font-size: 35rpx;font-weight: 600;">在职店员</view>
<view class="tn-flex tn-flex-center tn-flex-row-between" style="padding: 30rpx;">
<view class="tn-flex tn-flex-center tn-flex-col-center">
<view style="font-size: 30rpx;font-weight: 600;">李白</view>
<view style="margin-left: 20rpx;">1800000000</view>
<view style="margin-left: 20rpx;">
<tn-tag size="sm" backgroundColor="#FF7043" width="80rpx" shape="circle"
fontColor="#ffffff">未绑定</tn-tag>
<tn-tag size="sm" backgroundColor="#28B93D" width="80rpx" shape="circle"
fontColor="#ffffff">已绑定</tn-tag>
</view>
</view>
<view>
<tn-button backgroundColor="#E83A30" size="sm" shape="round" fontColor="#ffffff">删除</tn-button>
</view>
</view>
</view>
<tn-popup v-if="addClerkShow" :closeBtn="true" v-model="addClerkShow" mode="center" width="500rpx">
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">添加店员</view>
<view style="text-align: center;width: 400rpx;margin:0rpx auto;">
<tn-form :model="formAdd" ref="form" labelWidth="120">
<tn-form-item label="姓名" prop="name">
<tn-input v-model="formAdd.clerk_name" :clearable="false" />
</tn-form-item>
<tn-form-item label="手机号" prop="intro">
<tn-input v-model="formAdd.phone" :clearable="false" />
</tn-form-item>
</tn-form>
</view>
<view style="text-align: center;margin-top: 50rpx;padding-bottom: 50rpx;">
<tn-button shape="round" width="80%" backgroundColor="#3F8BF2" fontColor="#ffffff">确定</tn-button>
</view>
</tn-popup>
<tn-modal v-model="show" :title="title" :content="content" :button="button" @click="dian"></tn-modal>
</view>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'店员管理'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding: 30rpx;">
<view>当前店铺</view>
<view @click="select_show = true">
<text>{{ select_name }}</text>
<text class="tn-icon-down-triangle"></text>
</view>
</view>
<tn-select v-model="select_show" mode="single" :list="select_list" @confirm="add_confirm"></tn-select>
<view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="addClerkShow = true" fontColor="#ffffff">添加店员</tn-button>
</view>
<view style="margin: 20rpx;font-size: 35rpx;font-weight: 600;">在职店员</view>
<view v-for="(item,index) in list" class="tn-flex tn-flex-center tn-flex-row-between" style="padding: 30rpx;">
<view class="tn-flex tn-flex-center tn-flex-col-center">
<view style="font-size: 30rpx;font-weight: 600;">{{ item.clerk_name }}</view>
<view style="margin-left: 20rpx;" @click="open_phoen(item.phone)">{{ item.phone }}</view>
<view style="margin-left: 20rpx;">
<tn-tag v-if="item.if_bangding==2" size="sm" backgroundColor="#FF7043" width="80rpx" shape="circle"
fontColor="#ffffff">未绑定
</tn-tag>
<tn-tag v-if="item.if_bangding==1" size="sm" backgroundColor="#28B93D" width="80rpx" shape="circle"
fontColor="#ffffff">已绑定
</tn-tag>
</view>
</view>
<view>
<tn-button @click="del(item.id)" backgroundColor="#E83A30" size="sm" shape="round" fontColor="#ffffff">删除
</tn-button>
</view>
</view>
</view>
<tn-popup v-if="addClerkShow" :closeBtn="true" v-model="addClerkShow" mode="center" width="500rpx">
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">添加店员</view>
<view style="text-align: center;width: 400rpx;margin:0rpx auto;">
<tn-form :model="formAdd" ref="form" labelWidth="120">
<tn-form-item label="姓名" prop="name">
<tn-input v-model="formAdd.clerk_name" :clearable="false"/>
</tn-form-item>
<tn-form-item label="手机号" prop="intro">
<tn-input v-model="formAdd.phone" :clearable="false"/>
</tn-form-item>
</tn-form>
</view>
<view style="text-align: center;margin-top: 50rpx;padding-bottom: 50rpx;">
<tn-button @click="add()" shape="round" width="80%" backgroundColor="#3F8BF2" fontColor="#ffffff">确定
</tn-button>
</view>
</tn-popup>
<tn-modal v-model="show" :title="title" :content="content" :button="button" @click="dian"></tn-modal>
</view>
</template>
<script>
import {
clerkListByBusiness,
addClerk
} from "@/util/api";
import store from "@/store";
export default {
data() {
return {
show: false,
title: '提示信息',
content: '确定要删除店员吗?',
button: [{
text: '取消',
backgroundColor: '#F4F4F4',
fontColor: '#000000',
plain: true,
shape: 'round'
},
{
text: '确定',
backgroundColor: '#548ceb',
fontColor: '#FFFFFF'
}
],
addClerkShow: false,
formAdd: {
phone: '',
clerk_name: '',
},
select_show: false,
select_list: [{
value: '1',
label: 'A'
},
{
value: '2',
label: 'B'
},
{
value: '3',
label: 'C'
}
],
list: []
}
},
methods: {
add() {
addClerk({
business_id: d.code,
...formAdd
})
.then(res => {
console.log(res);
if (res.code == 1) {
import {
clerkListByBusiness,
addClerk,
businessListByMember, deleteClerk
} from "@/util/api";
import store from "@/store";
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
del() {
export default {
data() {
return {
show: false,
title: '提示信息',
content: '确定要删除店员吗?',
button: [{
text: '取消',
backgroundColor: '#F4F4F4',
fontColor: '#000000',
plain: true,
shape: 'round'
},
{
text: '确定',
backgroundColor: '#548ceb',
fontColor: '#FFFFFF'
}
],
addClerkShow: false,
formAdd: {
phone: '',
clerk_name: '',
},
id:'',
select_id: 0,
select_name: '',
select_show: false,
select_list: [],
list: []
}
},
onLoad() {
this.getClark();
},
methods: {
getClark() {
var userInfo = uni.getStorageSync('userInfo');
businessListByMember({
member_id: userInfo.id,
})
.then(res => {
console.log(res);
if (res.code == 1) {
var key = res.data;
const transformedSelectList = key.map(item => ({
value: item.id,
label: item.business_name
}));
this.select_name = transformedSelectList[0].label;
this.select_id = transformedSelectList[0].value;
this.select_list = transformedSelectList;
this.getList();
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
add_confirm(d) {
console.log(d);
var info = d[0];
this.select_name = info.label;
this.select_id = info.value;
},
add() {
if (this.formAdd.phone == '' || this.formAdd.clerk_name == '') {
uni.showToast({
title: '请填写店员信息',
icon: 'none',
duration: 2000
});
return;
}
addClerk({
business_id: this.select_id,
...this.formAdd
})
.then(res => {
console.log(res);
if (res.code == 1) {
uni.showToast({
title: '添加成功!',
icon: 'none',
duration: 2000
});
this.addClerkShow = false;
this.getList();
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
del(id) {
this.id=id;
this.show = true;
},
dian(d) {
console.log(d);
this.show = false;
if (d.index == 1) {
this.delDo();
}
},
delDo(){
deleteClerk({
id: this.id
})
.then(res => {
console.log(res);
if (res.code == 1) {
uni.showToast({
title: '删除成功!',
icon: 'none',
duration: 2000
});
this.getList();
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getList() {
clerkListByBusiness({
business_id: this.select_id
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.list = res.data;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
open_phoen(telephone) {
uni.makePhoneCall({
phoneNumber: telephone, //
success: function () {
console.log('拨打电话成功');
},
fail: function () {
console.log('拨打电话失败');
}
});
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
},
dian(d) {
console.log(d);
},
getList() {
clerkListByBusiness({
business_id: d.code,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.list = res.data;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
},
}
}
}
},
}
}
</script>
<style>

View File

@ -0,0 +1,168 @@
<template>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'会员卡核销'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view v-if="show">
<view style="text-align: center;padding: 30rpx;font-size: 50rpx;font-weight: 600">会员卡核销</view>
<view style="font-size: 30rpx;font-weight: 600;padding:20rpx 30rpx 20rpx 30rpx">持卡人信息</view>
<view style="padding:20rpx 30rpx 0rpx 30rpx">会员卡号{{code}}</view>
<view class="tn-flex tn-flex-col-center tn-flex-row-between"
style="background-color: #ffffff;padding:50rpx 30rpx;border-radius: 15rpx;margin-bottom: 20rpx;">
<view class="tn-flex tn-flex-col-center">
<view>
<image :src="apiImgUrl+info.photo_image"
style="width: 100rpx;height: 100rpx;border-radius: 50%;">
</image>
</view>
<view style="margin-left: 20rpx;">
<view style="font-size: 30rpx;font-weight: 600;">{{info.member_nikename}}</view>
<view style="font-size: 28rpx;margin-top: 10rpx">{{info.member_phone}}</view>
</view>
</view>
</view>
<view style="font-size: 30rpx;font-weight: 600;padding:20rpx 30rpx 20rpx 30rpx">核销人{{info.clerk_name}}
</view>
<view style="margin-top: 100rpx;text-align: center">
<tn-button @click="submitDo" width="400rpx" height="80rpx" backgroundColor="#28B93D"
fontColor="#ffffff" shape="round">确认核销</tn-button>
</view>
</view>
</view>
</view>
</template>
<script>
import {
ifRightToExamine,
addWriteoff
} from "@/util/api";
import store from "@/store";
export default {
data() {
return {
show: false,
code: '',
apiImgUrl: this.$store.state.imgUrl,
info: {},
key:'',
}
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
var data = this.getUrlParams(q);
this.code = data.key;
this.key = data.random_number;
this.association_id = data.association_id;
getApp().getUserLogin((r) => {
console.log('111', r);
this.phone = r.data.phone;
this.checkUser();
})
},
methods: {
submitDo() {
addWriteoff({
association_id: this.association_id,
phone: this.phone,
code_number: this.code,
random_number:this.key
})
.then(res => {
console.log(res);
if(res.code==1){
uni.showToast({
title: '核销成功!',
icon: 'none',
duration: 2000
});
}else{
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: function(res) {
that.goBack();
}
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
checkUser() {
var that = this;
console.log(this.association_id);
console.log(this.phone);
console.log(this.code);
ifRightToExamine({
association_id: this.association_id,
phone: this.phone,
code_number: this.code,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.show = true;
this.info = res.data;
} else {
this.show = false;
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: function(res) {
that.goBack();
}
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getUrlParams(url) {
// \w+ (线), [\u4e00-\u9fa5]+
let pattern = /(\w+|[\u4e00-\u9fa5]+)=(\w+|[\u4e00-\u9fa5]+)/ig;
let result = {};
url.replace(pattern, ($, $1, $2) => {
result[$1] = $2;
})
return result
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
},
}
}
</script>
<style>
</style>

View File

@ -38,7 +38,8 @@
<!-- tabbar item的文字-->
<view class="tn-tabbar__content__item__text" :class="[elColor(index, false)]" :style="{
color: elColor(index),
fontSize: `${fontSize}rpx`
fontSize: `${fontSize}rpx`,
fontWeight:thisIndex==index?600:500
}">
<text class="tn-text-ellipsis">{{ item.title }}</text>
</view>
@ -89,6 +90,10 @@
type: Number,
default: 100
},
thisIndex: {
type: Number,
default: 0
},
//
outHeight: {
type: Number,

View File

@ -71,3 +71,13 @@ export const businessFind = data => request.post('/move/business/businessFind',
export const clerkListByBusiness = data => request.post('/move/business/getClerkListByBusinessId', data, false);
export const addClerk = data => request.post('/move/business/addClerk', data, false);
export const businessListByMember = data => request.post('/move/business/getBusinessListByMemberId', data, false);
export const deleteClerk = data => request.post('/move/business/deleteClerk', data, false);
export const handleMembercode = data => request.post('/move/Membercode/handleMembercode', data, false);
export const ifRightToExamine = data => request.post('/move/Writeoff/ifRightToExamine', data, false);
export const addWriteoff = data => request.post('/move/Writeoff/addWriteoff', data, false);