|
@@ -34,8 +34,18 @@
|
|
|
title
|
|
|
:loading='loading'
|
|
|
></u-skeleton> -->
|
|
|
+ <view v-if='islongPress'>
|
|
|
+ <view @click="del">删除</view>
|
|
|
+ <view @click='islongPress=false'>取消</view>
|
|
|
+ <u-checkbox-group placement="column"
|
|
|
+ @change="checkboxChange($event,'')">
|
|
|
+ <u-checkbox :checked='checked' name='全部' :customStyle="{marginBottom: '8px'}">
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+ </view>
|
|
|
+
|
|
|
<mescroll-body v-if='cardHolderList' :up="upOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
|
|
|
- <view v-for='item in cardHolderList' class="content3 flex">
|
|
|
+ <view v-for='(item,index) in cardHolderList' @longpress="longpress" class="content3 flex">
|
|
|
<view class="left">
|
|
|
<view class="top flex-row-center">
|
|
|
<image :src="item.cardManagementInfo.headSculpture" mode="widthFix" class="img"></image>
|
|
@@ -43,7 +53,7 @@
|
|
|
<view class="bottom flex flex-evenly">
|
|
|
<uni-icons type="home" size="20"></uni-icons>
|
|
|
<text @click='switchType(item)'>{{item.classify?item.classifyName:'默'}}</text>
|
|
|
- <uni-icons type="redo" size="20"></uni-icons>
|
|
|
+ <uni-icons @click='share(item)' type="redo" size="20" color=''></uni-icons>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="right">
|
|
@@ -51,6 +61,11 @@
|
|
|
<text>{{item.cardManagementInfo.name}}</text>
|
|
|
<text class="line"></text>
|
|
|
<text>{{item.cardManagementInfo.post}}</text>
|
|
|
+ <u-checkbox-group v-if='islongPress' placement="column"
|
|
|
+ @change="checkboxChange($event,index)">
|
|
|
+ <u-checkbox :name='index+1' :checked='item.checked' :customStyle="{marginBottom: '8px'}">
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
</view>
|
|
|
<view class="row2">
|
|
|
{{item.cardManagementInfo.companyName}}
|
|
@@ -63,9 +78,9 @@
|
|
|
<uni-icons type="redo" size="20"></uni-icons>
|
|
|
<text>{{item.cardManagementInfo.phone}}</text>
|
|
|
</view>
|
|
|
- <view class="row3">
|
|
|
+ <view @click='remarkEdit(item)' class="row3">
|
|
|
<uni-icons type="redo" size="20"></uni-icons>
|
|
|
- <text>我是备注</text>
|
|
|
+ <text >{{item.remark?item.remark:'单击添加备注'}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -75,6 +90,49 @@
|
|
|
<lyuan-tx-asr ref="asr" :uploadMethod="uploadFile" @change="asrChange" @fileChange="fileChange" appId=""
|
|
|
secretId="" secretKey=""></lyuan-tx-asr>
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
|
+ <u-modal :show="delShow" title="提示" showCancelButton='true' @cancel="delShow=false" @confirm="delConfirm" :content='"已选中"+this.checkedList.length+"张名片,确定删除?"'></u-modal>
|
|
|
+ <u-modal :show="modalShow" @confirm='remarkConfirm' :confirmColor="remark?'#2979ff':'#ccc'" showCancelButton='true' title="备注" >
|
|
|
+ <view class="slot-content">
|
|
|
+ <u--textarea v-model="remark" placeholder="输入备注,不超过150个字" ></u--textarea>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
+ <view v-if='qrcodeShow' class="shade">
|
|
|
+ <view class='qrCode'>
|
|
|
+ <view style='text-align:right;'>
|
|
|
+ <uni-icons @click='qrcodeShow=false' type="close" size="20"></uni-icons>
|
|
|
+ </view>
|
|
|
+ <image :src="currectData.cardManagementInfo.qrCode" mode=""></image>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <u-popup :show="popupshow" mode="bottom">
|
|
|
+ <view>
|
|
|
+ <view class="share-to">
|
|
|
+ <text>分享到</text>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+
|
|
|
+ <view class="block" @click="toUrl()">
|
|
|
+ <button class="moment">
|
|
|
+ <text class="iconfont icon-weixin"></text>
|
|
|
+ <!-- <image src="/static/img/moment.png" mode="aspectFill"></image> -->
|
|
|
+ <text>扫码分享</text>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <view class="block">
|
|
|
+ <button class="wechat" open-type="share">
|
|
|
+ <text class="iconfont icon-pengyouquan"></text>
|
|
|
+ <!-- <image src="/static/img/wechat.png" mode="aspectFill"></image> -->
|
|
|
+ <button class="shareBtn" type="default" data-name="shareBtn">
|
|
|
+ 分享给微信好友</button>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="cancel" @click.stop="handleHiddenShare">
|
|
|
+ <text>取消</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -91,7 +149,15 @@
|
|
|
typeColumns: [],
|
|
|
cardHolderList:[],
|
|
|
currectData:[],
|
|
|
- type:1
|
|
|
+ type:1,
|
|
|
+ popupshow:false,
|
|
|
+ modalShow:false,
|
|
|
+ remark:'',
|
|
|
+ islongPress: false,
|
|
|
+ checked:false,
|
|
|
+ checkedList:[],
|
|
|
+ delShow:false,
|
|
|
+ qrcodeShow:false,
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -103,16 +169,143 @@
|
|
|
}
|
|
|
this.searchVal = uni.getStorageSync("search_val") ? uni.getStorageSync("search_val") : ''
|
|
|
},
|
|
|
+ onShareAppMessage(res) {
|
|
|
+ debugger
|
|
|
+ let that = this;
|
|
|
+ let imageUrl = that.shareUrl || '';
|
|
|
+ if (res.from === 'button') {
|
|
|
+ //这块需要传参,不然链接地址进去获取不到数据
|
|
|
+ let path = `/` + that.$scope.route + `?item=` + that.$scope.options.item;
|
|
|
+ return {
|
|
|
+ title: '名片夹',
|
|
|
+ path: path,
|
|
|
+ imageUrl: imageUrl
|
|
|
+ };
|
|
|
+ }
|
|
|
+ // if (res.from === 'menu') {
|
|
|
+ // return {
|
|
|
+ // title: '商通线上商城',
|
|
|
+ // path: '/pages/tabBarPro/index/index',
|
|
|
+ // imageUrl: imageUrl
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ toUrl(){
|
|
|
+ console.log(this.currectData)
|
|
|
+ this.popupshow=false
|
|
|
+ this.qrcodeShow=true
|
|
|
+ },
|
|
|
+ share(item){
|
|
|
+ this.currectData=item
|
|
|
+ this.popupshow=true
|
|
|
+ },
|
|
|
+ async delConfirm(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '数据加载中',
|
|
|
+ mask:true
|
|
|
+ })
|
|
|
+
|
|
|
+ for(var i=0;i<this.checkedList.length;i++){
|
|
|
+ await this.$request.baseRequest('admin.unimall.cardHolderInfo', 'delete',{
|
|
|
+ id:this.checkedList[i].data.id,
|
|
|
+ }, failres => {
|
|
|
+ console.log('res+++++', failres.errmsg)
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ }).then(res => {
|
|
|
+ console.log(i,this.checkedList.length-1)
|
|
|
+ if(i==this.checkedList.length-1){
|
|
|
+ uni.hideLoading()
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功',
|
|
|
+ })
|
|
|
+ this.delShow=false
|
|
|
+ this.islongPress=false
|
|
|
+ this.mescroll.resetUpScroll()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del(){
|
|
|
+ this.delShow=true
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ longpress(){
|
|
|
+ console.log("长按事件",1111111111);
|
|
|
+ this.islongPress = true;
|
|
|
+
|
|
|
+ },
|
|
|
+ checkboxChange(e, i) {
|
|
|
+ console.log(e,i,111111111)
|
|
|
+ if(i===''){
|
|
|
+ console.log(this.checked)
|
|
|
+ this.checked = !this.checked;
|
|
|
+ this.cardHolderList.map(item => item.checked = this.checked);
|
|
|
+ this.$forceUpdate()
|
|
|
+ var checkList = this.cardHolderList.filter((item) => {
|
|
|
+ return item.checked == true
|
|
|
+ })
|
|
|
+ var data=checkList.map((item,index) => {return {index:index,data:item}})
|
|
|
+ this.checkedList = JSON.parse(JSON.stringify(data))
|
|
|
+ }else{
|
|
|
+ if (e[0]) {
|
|
|
+ this.checkedList.push({index:i,data:this.cardHolderList[i]})
|
|
|
+ } else {
|
|
|
+ var index = this.checkedList.findIndex((item) => {
|
|
|
+ return item.index == i
|
|
|
+ })
|
|
|
+ this.checkedList.splice(index, 1)
|
|
|
+ }
|
|
|
+ if(this.checkedList.length!=this.cardHolderList.length){
|
|
|
+ this.checked=false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // for(var i=0;i<this.cardList.length;i++){
|
|
|
+ // console.log(this.cardList[i].checked)
|
|
|
+ // // if(this.cardList[i].checkedList.length>0){
|
|
|
+ // // this.checkedList.push(i)
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
+ console.log(this.checkedList)
|
|
|
+ },
|
|
|
+ remarkConfirm(){
|
|
|
+ if(this.remark){
|
|
|
+ this.currectData.remark=this.remark
|
|
|
+ this.$request.baseRequest('admin.unimall.cardHolderInfo', 'update',{
|
|
|
+ cardHolderInfo:JSON.stringify(this.currectData),
|
|
|
+ }, failres => {
|
|
|
+ console.log('res+++++', failres.errmsg)
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ }).then(res => {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改备注成功',
|
|
|
+ })
|
|
|
+ this.modalShow=false
|
|
|
+ this.mescroll.resetUpScroll()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ remarkEdit(item){
|
|
|
+ this.currectData=item
|
|
|
+ this.modalShow=true
|
|
|
+ },
|
|
|
switchType(item){
|
|
|
this.type=2
|
|
|
this.currectData=item
|
|
|
this.isShowType=true
|
|
|
-
|
|
|
},
|
|
|
typeConfirm(e){
|
|
|
if(this.type==2){
|
|
|
-
|
|
|
this.currectData.classify=e.value[0].circleName
|
|
|
this.$request.baseRequest('admin.unimall.cardHolderInfo', 'update',{
|
|
|
cardHolderInfo:JSON.stringify(this.currectData),
|
|
@@ -123,6 +316,10 @@
|
|
|
message: failres.errmsg,
|
|
|
})
|
|
|
}).then(res => {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改分类成功',
|
|
|
+ })
|
|
|
this.mescroll.resetUpScroll()
|
|
|
})
|
|
|
}else{
|
|
@@ -131,7 +328,6 @@
|
|
|
this.isShowType = false
|
|
|
},
|
|
|
init(){
|
|
|
-
|
|
|
this.$request.baseRequest('admin.unimall.cardClassifyInfo', 'list',{
|
|
|
page:1,
|
|
|
limit:9999,
|
|
@@ -170,6 +366,7 @@
|
|
|
let curPageLen = res.data.items.length;
|
|
|
let totalPage = res.data.total;
|
|
|
for (var i = 0; i < res.data.items.length; i++) {
|
|
|
+ res.data.items[i].checked=false
|
|
|
if(res.data.items[i].classify){
|
|
|
res.data.items[i].classifyName=res.data.items[i].classify[0]
|
|
|
}
|
|
@@ -322,15 +519,20 @@
|
|
|
},
|
|
|
selectType() {
|
|
|
this.isShowType = true
|
|
|
+ this.type=1
|
|
|
},
|
|
|
scan() {
|
|
|
// console.log(1)
|
|
|
- uni.scanCode({
|
|
|
- success: function(res) {
|
|
|
- console.log('条码类型:' + res.scanType);
|
|
|
- console.log('条码内容:' + res.result);
|
|
|
- }
|
|
|
- });
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/cardHolder/scancode"
|
|
|
+ })
|
|
|
+ // uni.scanCode({
|
|
|
+ // success: function(res) {
|
|
|
+ // console.log('条码类型:' + res.scanType);
|
|
|
+ // console.log('条码内容:' + res.result);
|
|
|
+
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
toMap() {
|
|
|
uni.navigateTo({
|
|
@@ -409,4 +611,23 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .slot-content{
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
+ .shade{
|
|
|
+ background:rgba(0,0,0,0.2);
|
|
|
+ width:100%;height:100vh;
|
|
|
+ position:fixed;
|
|
|
+ top:0;
|
|
|
+ left:0;
|
|
|
+ }
|
|
|
+ .qrCode{
|
|
|
+ position:absolute;
|
|
|
+ top:50%;
|
|
|
+ left:0;
|
|
|
+ right:0;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ text-align:center;
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|