瀏覽代碼

Merge branch 'localhost'

codeMan 1 年之前
父節點
當前提交
dcd26e016c
共有 4 個文件被更改,包括 243 次插入22 次删除
  1. 16 12
      cloud/businessCard/index.vue
  2. 177 4
      cloud/businessCard/share.vue
  3. 49 6
      static/iconfont/iconfont.css
  4. 1 0
      static/workbench/邮箱.svg

+ 16 - 12
cloud/businessCard/index.vue

@@ -22,7 +22,6 @@
                     </view>
                     <view class="right">
                         <image :src="userInfo.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'" mode="widthFix">
-                            
                         </image>
                     </view>
                 </view>
@@ -38,7 +37,7 @@
                         </view>
                         <view style="margin-bottom: 0 !important;">
                             <i class="iconfont icon-dizhi_xian"></i>
-                            <view class="text u-line-2">{{ userInfo.address ||'暂无' }}都是第三方神鼎飞丹砂发斯蒂芬斯蒂芬是的防守打法收到防守打法</view>
+                            <view class="text u-line-2">{{ userInfo.address ||'暂无' }}</view>
                         </view>
                     </view>
                     <view class="right">
@@ -85,10 +84,10 @@
                     </view>
                 </contact>
                 
-                <view class="item" hover-class="navigator-hover" @click="goCard">
+                <navigator class="item" :url="'/cloud/businessCard/share?id='+userid">
                     <image mode="widthFix" src="/static/workbench/名片海报.svg" />
                     <text>名片海报</text>
-                </view>
+                </navigator>
             </view>
         </u-popup>
     </view>
@@ -106,11 +105,11 @@ export default {
         }
     },
     methods: {  
-        async getuserInfo () {
+        async getuserInfo (id) {
             let res = await this.$Http.basic({
                 "id": 20240514161502,
                 "content": {
-                    userid:this.userid
+                    userid:id
                 },
             })
             this.userInfo = res.data
@@ -148,10 +147,6 @@ export default {
         },
         shareWx () {
 
-        },
-        goCard () {
-
-            
         }
     },
     onShareAppMessage(res) {
@@ -163,7 +158,6 @@ export default {
     },
     onLoad(options) {
         console.log("被邀请加入团队", options)
-        this.sys_enterpriseid = options.userid;
         const systemInitIsComplete = this.$Http.systemInitIsComplete;
         if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
             this.$Http.HomePageStartRendering = render(this)
@@ -171,7 +165,14 @@ export default {
             render(this)
         }
         function render(that) {
-            that.getuserInfo()
+            if (options.q) {
+                let params = that.getUrlParams(options.q);
+                user.wechatBindUserid = params.wechatBindUserid;
+                that.userid = params.wechatBindUserid
+            } else {
+                that.userid = uni.getStorageSync('userMsg').userid
+            }
+            that.getuserInfo(that.userid)
         }
     },
 }
@@ -290,6 +291,9 @@ export default {
                         display: flex;
                         align-content: center;
                         align-items: center;
+                        i {
+                            font-size: 16px;
+                        }
                         .text {
                             margin-left: 10px;
                             max-width: 211px;

+ 177 - 4
cloud/businessCard/share.vue

@@ -1,13 +1,186 @@
 <template>
-    <view>
-        名片海报
+    <view class="card-box">
+        <lPainter ref="painter" css="position:relative;">
+            <lPainterView :css="'background:#ffffff;width:'+tovw(280)+';height:'+tovw(463)">
+                <lPainterImage :src="imageUrl" :css="'width:'+tovw(280)+';height:'+tovw(200)" object-fit="fill" />
+
+                <lPainterView :css="'display: flex;flex-direction: column;margin:auto;align-items: center;position: absolute;bottom: '+tovw(25)+';width:'+tovw(140)">
+                    <lPainterView :css="'width:'+tovw(56)+';height:'+tovw(56)+';border-radius:50%;background:#ffffff'">
+                        <lPainterImage :src="userInfo.headpoc || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'" :css="'width:'+tovw(56)+';height:'+tovw(56)+';border-radius:50%;border: 2px solid #FFFFFF'" object-fit="fill" />
+                    </lPainterView>
+                    <lPainterView :css="'display: flex;align-items: center;align-content: center;font-family: Source Han Sans SC, Source Han Sans SC;padding-top:'+tovw(10)">
+                        <lPainterText :text="userInfo.name||'暂无'" :css="'font-weight: 500;font-size: '+tovw(18)+';color: #333333;'"></lPainterText>
+                        <lPainterView :css="'border: 1px solid #C30D23;padding-top:'+tovw(5)+';padding-bottom:'+tovw(5)+';padding-left:'+tovw(5)+';padding-right:'+tovw(5)+';margin-top:'+tovw(15)+';margin-bottom:'+tovw(15)+';margin-left:'+tovw(12)+';margin-right:'+tovw(12)+';color: #C30D23;border-radius:'+tovw(10)"><lPainterText :text="userInfo.rolenames||'暂无'" :css="'font-size:'+tovw(10)"></lPainterText></lPainterView>
+                    </lPainterView>
+
+                    <lPainterView :css="'margin-bottom: '+tovw(10)+';display: flex;align-items: center;align-content: center;align-self: self-start'">
+                        <lPainterImage src="/static/workbench/邮箱.svg" :css="'width:'+tovw(14)+';height:'+tovw(14)"></lPainterImage>
+                        <lPainterText :css="'margin-left: '+tovw(10)+';font-weight: 400;font-size: '+tovw(12)+';color: #666666;'" :text="userInfo.phonebumber||'暂无'"></lPainterText>
+                    </lPainterView>
+
+                    <lPainterView :css="'margin-bottom: '+tovw(21)+';display: flex;align-items: center;align-content: center;align-self: self-start'">
+                        <lPainterImage src="/static/workbench/邮箱.svg" :css="'width:'+tovw(14)+';height:'+tovw(14)"></lPainterImage>
+                        <lPainterText :css="'margin-left: '+tovw(10)+';font-weight: 400;font-size: '+tovw(12)+';color: #666666;'" :text="userInfo.email||'暂无'"></lPainterText>
+                    </lPainterView>
+
+                    <lPainterView :css="'display: flex;flex-direction: column;align-content: center;align-items: center;font-weight: 400;font-size: '+tovw(10)+';color: #999999'">
+                        <lPainterQrcode :text="qrCode + 'callingCard?userid=' + userid" :css="'width: '+tovw(70)+'; height: '+tovw(70)+';color:#000;'" />
+                        <lPainterText :css="'font-weight: 400;font-size: '+tovw(12)+';color: #666666;margin-top:'+tovw(5)" :text="'请长按扫码'"></lPainterText>
+                    </lPainterView>
+                </lPainterView>
+            </lPainterView>
+            
+        </lPainter>
+        <view class="bottom">
+            <view class="but" @click="loading?'':saveTheImage()" hover-class="navigator-hover">
+                <u-loading-icon v-if="loading" color="#fff" />
+                <text v-else>保存名片海报</text>
+            </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"
 export default {
-
+    components: { lPainter, lPainterView, lPainterText, lPainterImage, lPainterQrcode },
+    data () {
+        return {
+            userInfo:{},
+            userid:'',
+            imageUrl:'',
+            loading:false
+        }
+    },
+    methods: {
+        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;
+                        },
+                        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,
+                                })
+                            }
+                        },
+                    });
+                },
+            });
+        },
+        async getuserInfo (id) {
+            let res = await this.$Http.basic({
+                "id": 20240514161502,
+                "content": {
+                    userid:this.userid
+                },
+            })
+            this.userInfo = res.data
+            console.log(this.userInfo,'用户信息');
+        },
+        async getImages () {
+            let res = await this.$Http.basic({
+                id:20240426154302,
+                content: {
+                    systemclient:'wechatsaletool',
+                    locations:['business_card']
+                }
+            })
+            if (res.data.business_card.length) {
+                this.imageUrl = res.data.business_card[0].attinfos.length && res.data.business_card[0].attinfos[0].url
+            }
+            console.log(this.imageUrl,'海报广告图');
+        }  
+    },
+    onLoad (option) {
+        this.userid = option.id
+        this.getImages()
+        this.getuserInfo()
+    }   
 }
 </script>
 
-<style></style>
+<style lang="scss">
+.card-box {
+    width:280px;
+    height: 463px;
+    background: #ffffff;
+    margin: 20px auto 0 auto;
+    box-sizing: border-box;
+    .bottom {
+        display: flex;
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        width: 375px;
+        height: 64px;
+        background: #FFFFFF;
+        box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+        box-sizing: border-box;
+        z-index: 9999999;
+        padding: 10px;
+        .but { 
+            width: 355px;
+            height: 45px;
+            font-family: PingFang SC, PingFang SC;
+            font-weight: 500;
+            font-size: 14px;
+            color: #FFFFFF;
+            background: #C30D23;
+            border-radius: 5px 5px 5px 5px;
+            border: 1px solid #FFFFFF;
+            display: flex;
+            align-items: center;
+            align-content: center;
+            justify-content: space-evenly;
+        }
+    }
+}
+</style>

+ 49 - 6
static/iconfont/iconfont.css

@@ -1,9 +1,8 @@
 @font-face {
-  font-family: "iconfont";
-  /* Project id 4131149 */
-  src: url('//at.alicdn.com/t/c/font_4131149_hoe3juck786.woff2?t=1715763659602') format('woff2'),
-    url('//at.alicdn.com/t/c/font_4131149_hoe3juck786.woff?t=1715763659602') format('woff'),
-    url('//at.alicdn.com/t/c/font_4131149_hoe3juck786.ttf?t=1715763659602') format('truetype');
+  font-family: "iconfont"; /* Project id 4131149 */
+  src: url('//at.alicdn.com/t/c/font_4131149_od1w04hipjs.woff2?t=1715924322036') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4131149_od1w04hipjs.woff?t=1715924322036') format('woff'),
+       url('//at.alicdn.com/t/c/font_4131149_od1w04hipjs.ttf?t=1715924322036') format('truetype');
 }
 
 .iconfont {
@@ -14,6 +13,50 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-shouji_xian:before {
+  content: "\e6de";
+}
+
+.icon-mingpianhaibao:before {
+  content: "\e6dc";
+}
+
+.icon-weixinhaoyou:before {
+  content: "\e6dd";
+}
+
+.icon-zhuanfa:before {
+  content: "\e6d9";
+}
+
+.icon-fuzhi:before {
+  content: "\e6da";
+}
+
+.icon-erweima:before {
+  content: "\e6db";
+}
+
+.icon-riqi:before {
+  content: "\e6d8";
+}
+
+.icon-mendian1:before {
+  content: "\e6d5";
+}
+
+.icon-dizhi_xian:before {
+  content: "\e6d6";
+}
+
+.icon-youxiang:before {
+  content: "\e6d7";
+}
+
+.icon-weidianzan:before {
+  content: "\e6cb";
+}
+
 .icon-baocunbendi:before {
   content: "\e6d0";
 }
@@ -156,4 +199,4 @@
 
 .icon-dizhi-hui:before {
   content: "\e6af";
-}
+}

+ 1 - 0
static/workbench/邮箱.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14"><defs><style>.a,.c{fill:#999;}.a{stroke:#707070;}.b{clip-path:url(#a);}</style><clipPath id="a"><rect class="a" width="14" height="14" transform="translate(38 234)"/></clipPath></defs><g class="b" transform="translate(-38 -234)"><g transform="translate(38 235.85)"><path class="c" d="M14.456,4.153H3.555A1.552,1.552,0,0,0,2.006,5.7v7.2a1.552,1.552,0,0,0,1.55,1.55h10.9a1.552,1.552,0,0,0,1.55-1.55V5.7a1.552,1.552,0,0,0-1.55-1.55Zm.62,8.751a.622.622,0,0,1-.62.62H3.555a.622.622,0,0,1-.62-.62V5.7a.622.622,0,0,1,.62-.62h10.9a.622.622,0,0,1,.62.62Z" transform="translate(-2.006 -4.153)"/><path class="c" d="M13.88,6.956,9.241,9.883,4.6,6.956a.465.465,0,0,0-.5.786l4.881,3.08a.465.465,0,0,0,.248.072h.015a.465.465,0,0,0,.248-.072l4.881-3.08a.466.466,0,1,0-.5-.786Z" transform="translate(-2.241 -4.494)"/></g></g></svg>