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": { "style": {
"navigationBarTitleText": "智慧云商协" "navigationBarTitleText": "智慧云商协"
} }
},
{
"path": "user/my_vip_off",
"style": {
"navigationBarTitleText": "智慧云商协"
}
} }
] ]
}, { }, {

View File

@ -175,7 +175,8 @@
</view> </view>
<scroll-view :scroll-x="true" style="padding:0rpx 30rpx;white-space: nowrap;width: 100%" <scroll-view :scroll-x="true" style="padding:0rpx 30rpx;white-space: nowrap;width: 100%"
v-if="actList.length>0"> 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;"> style="position: relative;;display: inline-block;width: 300rpx;text-align: center;background-color: #FFF;border-radius: 20rpx;overflow: hidden;margin-right: 20rpx;">
<view> <view>
<image :src="apiImgUrl+item.activity_image" mode="aspectFill" <image :src="apiImgUrl+item.activity_image" mode="aspectFill"
@ -212,10 +213,11 @@
activeColor="#3377FF" :current="current" name="name" @change="change" :fontSize="28"></tn-tabs> activeColor="#3377FF" :current="current" name="name" @change="change" :fontSize="28"></tn-tabs>
</view> </view>
</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 }" <view v-for="(item,index) in news_list" :class="{ 'rounded_corner': index === 0 }"
style="background-color: #ffffff;"> 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;"> style="padding: 20rpx;min-height: 200rpx;">
<view style="margin-left: 20rpx;" v-if="item.news_image"> <view style="margin-left: 20rpx;" v-if="item.news_image">
<image :src="apiImgUrl+item.news_image" mode="aspectFill" <image :src="apiImgUrl+item.news_image" mode="aspectFill"
@ -243,6 +245,11 @@
<tn-select :safeAreaInsetBottom="true" v-model="selectShow" mode="single" :list="selectList" <tn-select :safeAreaInsetBottom="true" v-model="selectShow" mode="single" :list="selectList"
@confirm="confirm"></tn-select> @confirm="confirm"></tn-select>
</view> </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> </view>
</template> </template>
@ -297,6 +304,17 @@
//this.getArticlePolicyListAll(); //this.getArticlePolicyListAll();
}, },
methods: { methods: {
callPhone() {
uni.makePhoneCall({
phoneNumber: '15503791530', //
success: function() {
console.log('拨打电话成功');
},
fail: function() {
console.log('拨打电话失败');
}
});
},
msg() { msg() {
return this.$store.state.msgCount; return this.$store.state.msgCount;
}, },

View File

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

View File

@ -1,36 +1,38 @@
<template> <template>
<view style="background-color: #EBF4F7;letter-spacing: 1rpx;min-height: 100vh;"> <view style="background-color: #EBF4F7;letter-spacing: 1rpx;min-height: 100vh;">
<tn-nav-bar :isBack="false" :bottomShadow="true" backgroundColor="#FFFFFF"> <tn-nav-bar :isBack="false" :bottomShadow="false" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"> <view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-center">
<view class="tn-margin-top" <view class="tn-margin-top" style="text-align: center;">
style="text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"> <text>发现</text>
<tn-tabs :list="[{name:'发现'}]" :current="topCurrent" activeColor="#000" :bold="false"
:fontSize="36"></tn-tabs>
</view> </view>
</view> </view>
</tn-nav-bar> </tn-nav-bar>
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}"> <view :style="{paddingTop: vuex_custom_bar_height + 'px'}"
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin"> 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="justify-content-item align-content-item" style="width: 100%;">
<view class="tn-flex tn-flex-col-center" <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);"> style="border-radius: 100rpx;padding: 15rpx 20rpx;width: 100%;background-color:#F1F2F8;">
<text <text
class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></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" <input v-model="content" class="justify-content-item" placeholder="请输入协会名称进行搜索" name="input"
placeholder-style="color:#AAAAAA" style="width: 90%;"></input> placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
</view> </view>
</view> </view>
<view> <!-- <view>
<view class="justify-content-item tn-text-center"> <view class="justify-content-item tn-text-center">
<tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx" <tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx"
@click="onsubmit()"> @click="onsubmit()">
<text class="tn-color-white"> </text> <text class="tn-color-white"> </text>
</tn-button> </tn-button>
</view>
</view> -->
</view>
</view>
</view>
</view>
</view>
<!-- <view class="tn-flex tn-flex-row-around tn-flex-center tn-flex-col-center" style="padding: 30rpx;">--> <!-- <view class="tn-flex tn-flex-row-around tn-flex-center tn-flex-col-center" style="padding: 30rpx;">-->
<!-- <view style="color: #E15033;">--> <!-- <view style="color: #E15033;">-->
<!-- <text class="tn-icon-sequence-vertical" style="vertical-align: middle;"></text>--> <!-- <text class="tn-icon-sequence-vertical" style="vertical-align: middle;"></text>-->
@ -58,7 +60,27 @@
<!-- <text class="tn-icon-down-triangle"></text>--> <!-- <text class="tn-icon-down-triangle"></text>-->
<!-- </view>--> <!-- </view>-->
<!-- </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;" <view v-for="(item,index) in list" style="position: relative;"
@click="tn('/pages/index/pizz_info?id='+item.id)"> @click="tn('/pages/index/pizz_info?id='+item.id)">
<view class="tn-flex tn-flex-center tn-flex-col-center" <view class="tn-flex tn-flex-center tn-flex-col-center"

View File

@ -75,7 +75,7 @@
</view> </view>
</view> </view>
</view> </view>
<view style="background-color: #fff;padding-bottom: 80rpx;"> <view style="background-color: #fff;padding-bottom: 0rpx;">
<view style="padding:0px 20rpx;"> <view style="padding:0px 20rpx;">
<tn-list-cell v-if="login" :arrow="true" @click="tn('/pages/packageA/user/my_card_holder')"> <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"> <view class="tn-flex tn-flex-center tn-flex-col-center">
@ -142,7 +142,8 @@
<view style="margin-left: 20rpx;">意见反馈</view> <view style="margin-left: 20rpx;">意见反馈</view>
</view> </view>
</tn-list-cell> </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"> <view class="tn-flex tn-flex-center tn-flex-col-center">
<image src="/static/ico12.png" style="width: 50rpx;height: 50rpx"></image> <image src="/static/ico12.png" style="width: 50rpx;height: 50rpx"></image>
<view style="margin-left: 20rpx;">会员卡</view> <view style="margin-left: 20rpx;">会员卡</view>
@ -202,7 +203,11 @@
</view> </view>
<view style="height: 120rpx;"></view> <view style="height: 120rpx;"></view>
</tn-popup> </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> </view>
</template> </template>

View File

@ -14,6 +14,7 @@
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}"> <view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view style="text-align: center;padding: 30rpx;"> <view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="openQrcode" fontColor="#ffffff">出示二维码</tn-button> <tn-button backgroundColor="#01BEFF" @click="openQrcode" fontColor="#ffffff">出示二维码</tn-button>
<view style="margin-top: 20rpx;">会员卡号{{ code }}</view>
</view> </view>
</view> </view>
<tn-tabs :list="list" :isScroll="true" :activeItemStyle="{fontSize:'30rpx',fontWeight:'600'}" <tn-tabs :list="list" :isScroll="true" :activeItemStyle="{fontSize:'30rpx',fontWeight:'600'}"
@ -30,10 +31,12 @@
</image> </image>
</view> </view>
<view style="margin-left: 20rpx;"> <view style="margin-left: 20rpx;">
<view style="font-size: 31rpx;font-weight: 600;letter-spacing: 5rpx;">{{item.business_name}} <view style="font-size: 31rpx;font-weight: 600;letter-spacing: 5rpx;">
{{ item.business_name }}
</view> </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.address }}
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">电话{{item.telephone}} </view>
<view style="font-size: 24rpx;color: #808080;margin-top: 15rpx;">电话{{ item.telephone }}
</view> </view>
</view> </view>
</view> </view>
@ -53,24 +56,27 @@
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">核销二维码</view> <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;"> <view style="text-align: center;width: 300rpx;margin:0rpx auto;">
<l-painter ref="painter" css="background: #fff;width: 300rpx;text-align: center;"> <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-qrcode :text="qrcode_url" css="width: 300rpx; height: 300rpx"/>
</l-painter> </l-painter>
</view> </view>
<view style="text-align: center;margin-top: 50rpx;"> <view style="text-align: center;margin-top: 50rpx;">
<tn-button @click="show= false" shape="round" width="80%" backgroundColor="#3F8BF2" <tn-button @click="show= false" shape="round" width="80%" backgroundColor="#3F8BF2"
fontColor="#ffffff">关闭</tn-button> fontColor="#ffffff">关闭
</tn-button>
</view> </view>
</tn-popup> </tn-popup>
</view> </view>
</template> </template>
<script> <script>
import { import {
businesstypeList, businesstypeList,
businessList businessList,
} from "@/util/api"; handleMembercode
import store from "@/store"; } from "@/util/api";
export default { import store from "@/store";
export default {
data() { data() {
return { return {
current: 0, current: 0,
@ -80,12 +86,14 @@
page: 1, page: 1,
type: 0, type: 0,
apiImgUrl: this.$store.state.imgUrl, apiImgUrl: this.$store.state.imgUrl,
sp_list: [] sp_list: [],
code: 0,
} }
}, },
onLoad() { onLoad() {
this.getbusinesstypeList(); this.getbusinesstypeList();
this.getbusinessList(); this.getbusinessList();
this.setHandleMembercode();
}, },
methods: { methods: {
change(d) { change(d) {
@ -96,6 +104,25 @@
this.sp_list = []; this.sp_list = [];
this.getbusinessList(); 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() { getbusinessList() {
var u = uni.getStorageSync('userInfo'); var u = uni.getStorageSync('userInfo');
businessList({ businessList({
@ -139,9 +166,18 @@
}); });
}) })
}, },
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() { openQrcode() {
var u = uni.getStorageSync('userInfo'); var u = uni.getStorageSync('userInfo');
this.qrcode_url = store.state.apiUrl + "?type=2&key=123456789-" + u.id + "-" + u.association_id + ""; this.qrcode_url = store.state.imgUrl + "?type=2&key=" + this.code + "&association_id=" + u.association_id + "&random_number=" + this.generateUUIDv4();
setTimeout(() => { setTimeout(() => {
this.show = true; this.show = true;
}, 500) }, 500)
@ -162,11 +198,11 @@
} }
}, },
} }
} }
</script> </script>
<style> <style>
page { page {
background-color: aliceblue; background-color: aliceblue;
} }
</style> </style>

View File

@ -15,28 +15,31 @@
<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding: 30rpx;"> <view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding: 30rpx;">
<view>当前店铺</view> <view>当前店铺</view>
<view @click="select_show = true"> <view @click="select_show = true">
<text>123456</text> <text>{{ select_name }}</text>
<text class="tn-icon-down-triangle"></text> <text class="tn-icon-down-triangle"></text>
</view> </view>
</view> </view>
<tn-select v-model="select_show" mode="single" :list="select_list"></tn-select> <tn-select v-model="select_show" mode="single" :list="select_list" @confirm="add_confirm"></tn-select>
<view style="text-align: center;padding: 30rpx;"> <view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="addClerkShow = true" fontColor="#ffffff">添加店员</tn-button> <tn-button backgroundColor="#01BEFF" @click="addClerkShow = true" fontColor="#ffffff">添加店员</tn-button>
</view> </view>
<view style="margin: 20rpx;font-size: 35rpx;font-weight: 600;">在职店员</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 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 class="tn-flex tn-flex-center tn-flex-col-center">
<view style="font-size: 30rpx;font-weight: 600;">李白</view> <view style="font-size: 30rpx;font-weight: 600;">{{ item.clerk_name }}</view>
<view style="margin-left: 20rpx;">1800000000</view> <view style="margin-left: 20rpx;" @click="open_phoen(item.phone)">{{ item.phone }}</view>
<view style="margin-left: 20rpx;"> <view style="margin-left: 20rpx;">
<tn-tag size="sm" backgroundColor="#FF7043" width="80rpx" shape="circle" <tn-tag v-if="item.if_bangding==2" size="sm" backgroundColor="#FF7043" width="80rpx" shape="circle"
fontColor="#ffffff">未绑定</tn-tag> fontColor="#ffffff">未绑定
<tn-tag size="sm" backgroundColor="#28B93D" width="80rpx" shape="circle" </tn-tag>
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> </view>
<view> <view>
<tn-button backgroundColor="#E83A30" size="sm" shape="round" fontColor="#ffffff">删除</tn-button> <tn-button @click="del(item.id)" backgroundColor="#E83A30" size="sm" shape="round" fontColor="#ffffff">删除
</tn-button>
</view> </view>
</view> </view>
</view> </view>
@ -45,15 +48,16 @@
<view style="text-align: center;width: 400rpx;margin:0rpx auto;"> <view style="text-align: center;width: 400rpx;margin:0rpx auto;">
<tn-form :model="formAdd" ref="form" labelWidth="120"> <tn-form :model="formAdd" ref="form" labelWidth="120">
<tn-form-item label="姓名" prop="name"> <tn-form-item label="姓名" prop="name">
<tn-input v-model="formAdd.clerk_name" :clearable="false" /> <tn-input v-model="formAdd.clerk_name" :clearable="false"/>
</tn-form-item> </tn-form-item>
<tn-form-item label="手机号" prop="intro"> <tn-form-item label="手机号" prop="intro">
<tn-input v-model="formAdd.phone" :clearable="false" /> <tn-input v-model="formAdd.phone" :clearable="false"/>
</tn-form-item> </tn-form-item>
</tn-form> </tn-form>
</view> </view>
<view style="text-align: center;margin-top: 50rpx;padding-bottom: 50rpx;"> <view style="text-align: center;margin-top: 50rpx;padding-bottom: 50rpx;">
<tn-button shape="round" width="80%" backgroundColor="#3F8BF2" fontColor="#ffffff">确定</tn-button> <tn-button @click="add()" shape="round" width="80%" backgroundColor="#3F8BF2" fontColor="#ffffff">确定
</tn-button>
</view> </view>
</tn-popup> </tn-popup>
<tn-modal v-model="show" :title="title" :content="content" :button="button" @click="dian"></tn-modal> <tn-modal v-model="show" :title="title" :content="content" :button="button" @click="dian"></tn-modal>
@ -61,12 +65,14 @@
</template> </template>
<script> <script>
import { import {
clerkListByBusiness, clerkListByBusiness,
addClerk addClerk,
} from "@/util/api"; businessListByMember, deleteClerk
import store from "@/store"; } from "@/util/api";
export default { import store from "@/store";
export default {
data() { data() {
return { return {
show: false, show: false,
@ -90,33 +96,35 @@
phone: '', phone: '',
clerk_name: '', clerk_name: '',
}, },
id:'',
select_id: 0,
select_name: '',
select_show: false, select_show: false,
select_list: [{ select_list: [],
value: '1',
label: 'A'
},
{
value: '2',
label: 'B'
},
{
value: '3',
label: 'C'
}
],
list: [] list: []
} }
}, },
onLoad() {
this.getClark();
},
methods: { methods: {
add() { getClark() {
addClerk({ var userInfo = uni.getStorageSync('userInfo');
business_id: d.code, businessListByMember({
...formAdd member_id: userInfo.id,
}) })
.then(res => { .then(res => {
console.log(res); console.log(res);
if (res.code == 1) { 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 => { .catch(error => {
@ -127,15 +135,94 @@
}); });
}) })
}, },
del() { 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) { dian(d) {
console.log(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() { getList() {
clerkListByBusiness({ clerkListByBusiness({
business_id: d.code, business_id: this.select_id
}) })
.then(res => { .then(res => {
console.log(res); console.log(res);
@ -151,6 +238,17 @@
}); });
}) })
}, },
open_phoen(telephone) {
uni.makePhoneCall({
phoneNumber: telephone, //
success: function () {
console.log('拨打电话成功');
},
fail: function () {
console.log('拨打电话失败');
}
});
},
goBack() { goBack() {
if (getCurrentPages().length > 1) { if (getCurrentPages().length > 1) {
uni.navigateBack() uni.navigateBack()
@ -162,7 +260,7 @@
} }
}, },
} }
} }
</script> </script>
<style> <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的文字--> <!-- tabbar item的文字-->
<view class="tn-tabbar__content__item__text" :class="[elColor(index, false)]" :style="{ <view class="tn-tabbar__content__item__text" :class="[elColor(index, false)]" :style="{
color: elColor(index), color: elColor(index),
fontSize: `${fontSize}rpx` fontSize: `${fontSize}rpx`,
fontWeight:thisIndex==index?600:500
}"> }">
<text class="tn-text-ellipsis">{{ item.title }}</text> <text class="tn-text-ellipsis">{{ item.title }}</text>
</view> </view>
@ -89,6 +90,10 @@
type: Number, type: Number,
default: 100 default: 100
}, },
thisIndex: {
type: Number,
default: 0
},
// //
outHeight: { outHeight: {
type: Number, 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 clerkListByBusiness = data => request.post('/move/business/getClerkListByBusinessId', data, false);
export const addClerk = data => request.post('/move/business/addClerk', 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);