瀏覽代碼

邀请绑定账号

xiaohaizhao 1 年之前
父節點
當前提交
50a65c8085
共有 6 個文件被更改,包括 471 次插入5 次删除
  1. 2 0
      pages.json
  2. 5 0
      team/team/index.vue
  3. 2 2
      team/team/modules/users.vue
  4. 4 0
      team/userCenter/modules/userList.vue
  5. 204 3
      team/userCenter/personal.vue
  6. 254 0
      team/userCenter/wechatbind.vue

+ 2 - 0
pages.json

@@ -106,6 +106,8 @@
 			}
 		}, {
 			"path": "userCenter/personal"
+		}, {
+			"path": "userCenter/wechatbind"
 		}]
 	}],
 	"preloadRule": {

+ 5 - 0
team/team/index.vue

@@ -24,6 +24,11 @@ export default {
             }]
         }
     },
+    onLoad() {
+        uni.setNavigationBarTitle({
+            title: '团队管理'
+        });
+    },
     methods: {
         changeCurrent({ index, name }) {
             this.current = index;

+ 2 - 2
team/team/modules/users.vue

@@ -28,7 +28,7 @@
 </template>
 
 <script>
-import userList from "./userList.vue"
+import userList from "../../userCenter/modules/userList.vue"
 export default {
     components: { userList },
     data() {
@@ -69,7 +69,7 @@ export default {
         },
         onClick(item) {
             uni.navigateTo({
-                url: '/team/userCenter/personal?id=' + item.userid
+                url: '/team/userCenter/personal?id=' + item.sys_enterprise_hrid
             });
         },
         onSearch(condition) {

+ 4 - 0
team/team/modules/userList.vue → team/userCenter/modules/userList.vue

@@ -89,4 +89,8 @@ export default {
     }
 
 }
+
+.item:last-child {
+    margin-bottom: 0;
+}
 </style>

+ 204 - 3
team/userCenter/personal.vue

@@ -1,13 +1,214 @@
 <template>
     <view>
-        个人信息编辑
+        <block v-if="detail.userid">
+            <view style="height: 10px;" />
+            <user :list="[detail]" />
+        </block>
+
+        <view class="head">
+            <view class="label">
+                基本信息
+            </view>
+            <view class="content">
+                仅显示已填信息<text style="padding: 0 2.5px;" /> <u-switch activeColor="#C40C24" v-model="unShowAll" />
+            </view>
+        </view>
+        <block v-for="item in showList" :key="item.key">
+            <view class="item" hover-class="navigator-hover" v-if="!unShowAll || detail[item.key] || item.value">
+                <view class="content">
+                    <view class="label">
+                        {{ item.label }}:
+                    </view>
+                    <view class="value">
+                        {{ detail[item.key] || item.value || '--' }}
+                    </view>
+                </view>
+            </view>
+        </block>
+        <view style="height: 70px;" />
+        <view class="footer">
+            <navigator class="insert" v-if="detail.iswechatbind == 0"
+                :url="'/team/userCenter/wechatbind?id=' + detail.userid">
+                绑定微信
+            </navigator>
+            <navigator class="invite" style="flex: 1;" url="/team/team/InviteUser">
+                编辑
+            </navigator>
+        </view>
     </view>
 </template>
 
 <script>
+import user from "./modules/userList"
 export default {
-
+    components: { user },
+    data() {
+        return {
+            sys_enterprise_hrid: 0,
+            detail: {
+                userid: 0
+            },
+            unShowAll: false,
+            showList: []
+        }
+    },
+    onLoad(options) {
+        console.log("options", options)
+        this.sys_enterprise_hrid = options.id;
+        uni.setNavigationBarTitle({
+            title: '人员信息'
+        });
+        this.getDetail()
+    },
+    methods: {
+        getDetail() {
+            this.$Http.basic({
+                "id": "20240411085402",
+                "content": {
+                    "sys_enterprise_hrid": this.sys_enterprise_hrid
+                }
+            }).then(res => {
+                console.log("门店人员信息", res)
+                if (this.cutoff(res.msg)) return;
+                this.detail = res.data;
+                this.showList = [{
+                    label: "姓名",
+                    key: "name"
+                }, {
+                    label: "手机号",
+                    key: "phonenumber"
+                }, {
+                    label: "性别",
+                    key: "sex"
+                }, {
+                    label: "生日",
+                    key: "birthday"
+                }, {
+                    label: "邮箱",
+                    key: "email"
+                }, {
+                    label: "店内职位",
+                    key: "position"
+                }, {
+                    label: "角色",
+                    key: "rolenames"
+                }, {
+                    label: "人员类型",
+                    value: res.isleader ? '主账号' : '子账号'
+                }, {
+                    label: "所属门店",
+                    key: "storenames"
+                }]
+            })
+        }
+    },
 }
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100vw;
+    height: 45px;
+    background: #F7F7F7;
+    padding: 0 10px;
+    box-sizing: border-box;
+
+    .label {
+        font-family: PingFang SC, PingFang SC;
+        font-weight: bold;
+        font-size: 15px;
+        color: #333333;
+        line-height: 22px;
+    }
+
+    .content {
+        display: flex;
+        align-items: center;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 14px;
+        color: #999999;
+    }
+}
+
+.item {
+    width: 100vw;
+    background: #fff;
+    padding-left: 10px;
+    box-sizing: border-box;
+
+    .content {
+        display: flex;
+        width: 100%;
+        padding: 15px 0;
+        padding-right: 10px;
+        box-sizing: border-box;
+        border-bottom: 0.5px solid #F2F2F2;
+
+        .label {
+            width: 100px;
+            margin-right: 10px;
+            line-height: 20px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 14px;
+            color: #666666;
+        }
+
+        .value {
+            line-height: 20px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 14px;
+            color: #333333;
+        }
+    }
+
+    .content:last-child {
+        border-bottom: 0;
+    }
+}
+
+.footer {
+    position: fixed;
+    bottom: 0;
+    display: flex;
+    justify-content: space-between;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    padding: 5px 10px;
+    box-sizing: border-box;
+
+    .insert {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 168px;
+        height: 45px;
+        background: #FFFFFF;
+        border-radius: 5px;
+        border: 1px solid #999999;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 16px;
+        color: #666666;
+        box-sizing: border-box;
+        margin-right: 10px;
+    }
+
+    .invite {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 177px;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 500;
+        font-size: 16px;
+        color: #FFFFFF;
+    }
+}
+</style>

+ 254 - 0
team/userCenter/wechatbind.vue

@@ -0,0 +1,254 @@
+<template>
+    <view>
+        <view class="painter-box" v-if="userMsg.userid" style="">
+            <view>
+                <l-painter ref="painter" css="position: relative;width: 280px; height: 426px">
+                    <l-painter-image
+                        src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405151715764356769B1a729abd.webp"
+                        css="width: 280px; height: 426px;position: absolute;" />
+                    <l-painter-image
+                        :src="userMsg.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'"
+                        css="width: 56px; height:56px;border-radius: 50%;position: absolute;top:20px;left:20px;z-index:2;"
+                        object-fit="fill" />
+                    <l-painter-text :text="name"
+                        css="width:180px;line-height:24px;height:24px;position: absolute;left:86px;top:21px;z-index:2;font-family: Source Han Sans SC, Source Han Sans SC;font-weight: 500;font-size: 16px;color: #333333;  overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" />
+                    <l-painter-text :text="userMsg.areaname"
+                        css="width:180px;line-height:20px;height:20px;position: absolute;left:86px;top:55px;z-index:2;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-family: Source Han Sans SC, Source Han Sans SC;font-size: 14px;color: #666666;" />
+                    <l-painter-text text="扫码绑定微信"
+                        css="width:72px;line-height:17px;position: absolute;left:50%;bottom:269px;z-index:2;margin-left:-36px;font-size: 12px;color: #666666;font-family: PingFang SC, PingFang SC;" />
+                    <l-painter-qrcode :text="qrCode + 'wechatBind?wechatBindUserid=' + userid"
+                        css="width: 200px; height: 200px;position: absolute;left:50%;bottom:55px;z-index:2;margin-left:-100px;" />
+                </l-painter>
+            </view>
+        </view>
+        <view style="height: 70px;" />
+        <view class="footer">
+            <view class="invite" style="flex: 1;" hover-class="navigator-hover" @click="saveTheImage">
+                保存图片
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import lPainter from "../../uni_modules/lime-painter/components/l-painter/l-painter.vue"
+import lPainterView from "../../uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue"
+import lPainterText from "../../uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue"
+import lPainterImage from "../../uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue"
+import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue"
+import contact from "../../components/contact"
+
+export default {
+    components: { lPainter, lPainterView, lPainterText, lPainterImage, lPainterQrcode, contact },
+    data() {
+        return {
+            userMsg: {
+                userid: 0
+            },
+            qrCode: this.qrCodePrefix,
+            name: "",
+            userid: 0,
+        }
+    },
+    onLoad(options) {
+        this.userid = options.id;
+        uni.setNavigationBarTitle({
+            title: '绑定微信'
+        });
+        this.getUserMsg()
+    },
+    methods: {
+        getUserMsg() {
+            this.$Http.basic({
+                "id": 20240510104102,
+                "content": {},
+            }).then(res => {
+                console.log("获取个人信息", res)
+                if (this.cutoff(res.msg)) return;
+                this.userMsg = res.data;
+                this.name = res.data.enterprise_hr.name ? res.data.enterprise_hr.name + ',邀请您加入' : '邀请您加入'
+            })
+        },
+        saveTheImage() {
+            let that = this;
+            this.loading = true;
+            this.$refs.painter.canvasToTempFilePathSync({
+                fileType: "jpg",
+                // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
+                pathType: 'url',
+                quality: 1,
+                success: (res) => {
+                    // 非H5 保存到相册
+                    // H5 提示用户长按图另存
+                    uni.saveImageToPhotosAlbum({
+                        filePath: res.tempFilePath,
+                        success: function (e) {
+                            uni.showModal({
+                                title: '提示',
+                                content: '图片已保存到系统相册',
+                                showCancel: false
+                            })
+                            that.loading = false;
+                            this.$Http.basic({
+                                "id": 20240319142702,
+                                "content": {
+                                    sat_sharematerialid: that.detail.sat_sharematerialid, type: 1
+                                }
+                            }).then(res => {
+                                console.log(type, '记录', res)
+                            })
+
+                        },
+                        fail: ({ errMsg }) => {
+                            if (errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
+                                uni.showModal({
+                                    title: '提示',
+                                    content: '请授权添加到相册权限后再试!',
+                                    showCancel: false,
+                                    complete: (complete) => {
+                                        uni.openSetting({
+                                            success: res => {
+                                                that.loading = false;
+                                                if (res.authSetting['scope.writePhotosAlbum']) {
+                                                    this.saveTheImage()
+                                                } else {
+                                                    uni.showModal({
+                                                        title: '提示',
+                                                        content: '未获取授权!已取消保存',
+                                                        showCancel: false,
+                                                    })
+                                                }
+                                            }
+                                        })
+                                    },
+                                })
+                            } else {
+                                that.loading = false;
+                                uni.showModal({
+                                    title: '提示',
+                                    content: '已取消保存',
+                                    showCancel: false,
+                                })
+                            }
+                        },
+                    });
+                },
+            });
+        },
+        onBack() {
+            uni.navigateBack();
+        },
+        getSheraDate() {
+            return {
+                title: this.name, // 标题
+                path: "/pages/index/index?wechatBindUserid=" + this.userid, // 分享路径
+                imageUrl: ""// 分享图
+            };
+        }
+    },
+    onShareAppMessage(res) {
+        return this.getSheraDate()
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.head {
+    position: relative;
+    width: 100vw;
+
+    .custom {
+        position: absolute;
+        width: 100vw;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 500;
+        font-size: 17px;
+        color: #FFFFFF;
+
+        .back {
+            position: absolute;
+            padding: 0 10px;
+            left: 0;
+            color: #fff;
+            font-size: 12px;
+            transform: rotateY(180deg);
+        }
+    }
+}
+
+.painter-box {
+    display: flex;
+    justify-content: center;
+    margin-top: 25px;
+}
+
+.share {
+    display: flex;
+    justify-content: space-around;
+    width: 275px;
+    margin: 30px auto 0;
+
+    .item {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 48px;
+        height: 48px;
+        border-radius: 50%;
+        background: rgba(255, 255, 255, 0.3);
+        overflow: hidden;
+
+        .iconfont {
+            font-size: 28px;
+            color: #fff;
+        }
+    }
+}
+
+
+.footer {
+    position: fixed;
+    bottom: 0;
+    display: flex;
+    justify-content: space-between;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    padding: 5px 10px;
+    box-sizing: border-box;
+
+    .insert {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 168px;
+        height: 45px;
+        background: #FFFFFF;
+        border-radius: 5px;
+        border: 1px solid #999999;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 16px;
+        color: #666666;
+        box-sizing: border-box;
+        margin-right: 10px;
+    }
+
+    .invite {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 177px;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 500;
+        font-size: 16px;
+        color: #FFFFFF;
+    }
+}
+</style>