Kaynağa Gözat

分享进入执行记录接口

xiaohaizhao 1 yıl önce
ebeveyn
işleme
56fbde150c

+ 5 - 0
.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "cSpell.words": [
+        "shareuserid"
+    ]
+}

+ 671 - 595
cloud/businessCard/index.vue

@@ -1,682 +1,758 @@
 <template>
-    <view class="self-card" :style="{ '--height': tovw(+CustomBar + 10) }">
-        <view class="footer" :style="{ height: (tovw(CustomBar).replace('vw', '')) * 375 / 100 + 'px' }"
-            style="background: linear-gradient( 225deg, #F43A50 0%, #C30D23 100%);top: 0;">
-            <view class="custom"
-                :style="{ height: (tovw(Custom.height).replace('vw', '')) * 375 / 100 + 'px', top: (tovw(Custom.top).replace('vw', '')) * 375 / 100 + 'px' }">
-                <view v-if="userInfo.name">{{ userInfo.name }}的名片</view>
-                <view v-else>暂无信息</view>
-                <view class="back" :style="{ lineHeight: (tovw(Custom.height).replace('vw', '')) * 375 / 100 + 'px' }"
-                    @click="onBack">
-                    <text class=" iconfont icon-a-wodetiaozhuan" />
-                </view>
-            </view>
+  <view class="self-card" :style="{ '--height': tovw(+CustomBar + 10) }">
+    <view
+      class="footer"
+      :style="{
+        height: (tovw(CustomBar).replace('vw', '') * 375) / 100 + 'px',
+      }"
+      style="
+        background: linear-gradient(225deg, #f43a50 0%, #c30d23 100%);
+        top: 0;
+      "
+    >
+      <view
+        class="custom"
+        :style="{
+          height: (tovw(Custom.height).replace('vw', '') * 375) / 100 + 'px',
+          top: (tovw(Custom.top).replace('vw', '') * 375) / 100 + 'px',
+        }"
+      >
+        <view v-if="userInfo.name">{{ userInfo.name }}的名片</view>
+        <view v-else>暂无信息</view>
+        <view
+          class="back"
+          :style="{
+            lineHeight:
+              (tovw(Custom.height).replace('vw', '') * 375) / 100 + 'px',
+          }"
+          @click="onBack"
+        >
+          <text class="iconfont icon-a-wodetiaozhuan" />
         </view>
-        <view class="head" :style="[{ height: tovw(+CustomBar + 184) }]"
-            style="background: linear-gradient( 225deg, #F43A50 0%, #C30D23 100%)">
-            <image class="bg-bottom" mode="aspectFill" src="/static/workbench/减去.svg">
-            </image>
-            <view class="card">
-                <view class="header">
-                    <view class="left">
-                        <view class="title">
-                            <text>{{ userInfo.name || '暂无' }}</text>
-                            <text>{{ userInfo.rolenames || '暂无' }}</text>
-                        </view>
-                        <text class="phone">{{ userInfo.phonebumber || '暂无' }}</text>
-                        <view class="redline"></view>
-                    </view>
-                    <navigator class="right">
-                        <image
-                            :src="userInfo.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'"
-                            mode="aspectFill">
-                        </image>
-                    </navigator>
-                </view>
-                <view class="bottom">
-                    <view class="left">
-                        <view>
-                            <i class="iconfont icon-qiye-hui"></i>
-                            <view class="text">{{ userInfo.enterprisename || '暂无' }}</view>
-                        </view>
-                        <view>
-                            <i class="iconfont icon-youxiang"></i>
-                            <view class="text">{{ userInfo.email || '暂无' }}</view>
-                        </view>
-                        <view style="margin-bottom: 0 !important;">
-                            <i class="iconfont icon-dizhi_xian"></i>
-                            <view class="text u-line-2">{{ userInfo.address || '暂无' }}</view>
-                        </view>
-                    </view>
-                    <navigator class="right" :url="'/cloud/businessCard/share?id=' + userid">
-                        <image class="code" src="/static/workbench/二维码.svg" />
-                        <text>名片码</text>
-                    </navigator>
-                </view>
-            </view>
-        </view>
-        <view class="card-handle">
-            <view class="top">
-                <view class="left">
-                    <view class="avatar">
-                        <block v-for="item in userInfo.readusers" :key="item.rowindex">
-                            <image
-                                :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'"
-                                v-if="item.rowindex < 4" :key="item.rowindex" />
-                        </block>
-                        <text style="color:#BBBBBB">...</text>
-                    </view>
-                    <view class="readcount">浏览了{{ userInfo.count_read }}</view>
-                </view>
-                <navigator url="#" class="right" @click="goodClick">
-                    <i :class="['iconfont', userInfo.islike == 1 ? ' icon-yidianzan' : ' icon-weidianzan']"
-                        :style="{ color: userInfo.islike ? '#C30D23' : '#666666' }"></i>
-                    <text>点赞{{ userInfo.count_like }}</text>
-                </navigator>
-            </view>
-            <view class="bottom">
-                <view class="but" hover-class="navigator-hover" @click="copy">
-                    <i class="iconfont icon-fuzhi" style="color: #C30D23;"></i>
-                    复制电话
-                </view>
-                <view class="but" hover-class="navigator-hover" @click="shareClick">
-                    <i class="iconfont icon-zhuanfa"></i>
-                    转发名片
-                </view>
+      </view>
+    </view>
+    <view
+      class="head"
+      :style="[{ height: tovw(+CustomBar + 184) }]"
+      style="background: linear-gradient(225deg, #f43a50 0%, #c30d23 100%)"
+    >
+      <image
+        class="bg-bottom"
+        mode="aspectFill"
+        src="/static/workbench/减去.svg"
+      >
+      </image>
+      <view class="card">
+        <view class="header">
+          <view class="left">
+            <view class="title">
+              <text>{{ userInfo.name || "暂无" }}</text>
+              <text>{{ userInfo.rolenames || "暂无" }}</text>
             </view>
+            <text class="phone">{{ userInfo.phonebumber || "暂无" }}</text>
+            <view class="redline"></view>
+          </view>
+          <navigator class="right">
+            <image
+              :src="
+                userInfo.headpic ||
+                'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'
+              "
+              mode="aspectFill"
+            >
+            </image>
+          </navigator>
         </view>
-
-        <view class="user-info">
-            <text class="title-max">简介</text>
-            <view class="tag-box">
-                <text class="title-min">印象标签</text>
-                <view class="tag-list" v-if="userInfo.tag.length">
-                    <view class="tag" v-for="(item, index) in userInfo.tag" :key="index">{{ item }}</view>
-                </view>
-                <text v-else style="font-weight: 500;font-size: 14px;color: #666666;">暂无</text>
+        <view class="bottom">
+          <view class="left">
+            <view>
+              <i class="iconfont icon-qiye-hui"></i>
+              <view class="text">{{ userInfo.enterprisename || "暂无" }}</view>
             </view>
-            <view class="descript-box">
-                <text class="title-min">自我介绍</text>
-                <text class="descript">{{ userInfo.remarks || '暂无' }}</text>
+            <view>
+              <i class="iconfont icon-youxiang"></i>
+              <view class="text">{{ userInfo.email || "暂无" }}</view>
             </view>
-            <view class="image-box">
-                <text class="title-min">照片墙</text>
-                <block v-if="userInfo.images.length">
-                    <view class="image" v-for="item in userInfo.images" :key="item.attachmentid" @click="preview(item.url)">
-                        <u--image width="100%" :lazy-load="true" :src="item.url" radius="5"></u--image>
-                    </view>
-                </block>
-                <text v-else style="font-weight: 500;font-size: 14px;color: #666666;">暂无</text>
+            <view style="margin-bottom: 0 !important">
+              <i class="iconfont icon-dizhi_xian"></i>
+              <view class="text u-line-2">{{
+                userInfo.address || "暂无"
+              }}</view>
             </view>
+          </view>
+          <navigator
+            class="right"
+            :url="'/cloud/businessCard/share?id=' + userid"
+          >
+            <image class="code" src="/static/workbench/二维码.svg" />
+            <text>名片码</text>
+          </navigator>
+        </view>
+      </view>
+    </view>
+    <view class="card-handle">
+      <view class="top">
+        <view class="left">
+          <view class="avatar">
+            <block v-for="item in userInfo.readusers" :key="item.rowindex">
+              <image
+                :src="
+                  item.headpic ||
+                  'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'
+                "
+                v-if="item.rowindex < 4"
+                :key="item.rowindex"
+              />
+            </block>
+            <text style="color: #bbbbbb">...</text>
+          </view>
+          <view class="readcount">浏览了{{ userInfo.count_read }}</view>
         </view>
+        <navigator url="#" class="right" @click="goodClick">
+          <i
+            :class="[
+              'iconfont',
+              userInfo.islike == 1 ? ' icon-yidianzan' : ' icon-weidianzan',
+            ]"
+            :style="{ color: userInfo.islike ? '#C30D23' : '#666666' }"
+          ></i>
+          <text>点赞{{ userInfo.count_like }}</text>
+        </navigator>
+      </view>
+      <view class="bottom">
+        <view class="but" hover-class="navigator-hover" @click="copy">
+          <i class="iconfont icon-fuzhi" style="color: #c30d23"></i>
+          复制电话
+        </view>
+        <view class="but" hover-class="navigator-hover" @click="shareClick">
+          <i class="iconfont icon-zhuanfa"></i>
+          转发名片
+        </view>
+      </view>
+    </view>
 
-        <view class="footer2">
-            <navigator class="but" :url="'/cloud/businessCard/edit?id=' + userid" @click="goEditPage">
-                <text>修改名片</text>
-            </navigator>
+    <view class="user-info">
+      <text class="title-max">简介</text>
+      <view class="tag-box">
+        <text class="title-min">印象标签</text>
+        <view class="tag-list" v-if="userInfo.tag.length">
+          <view
+            class="tag"
+            v-for="(item, index) in userInfo.tag"
+            :key="index"
+            >{{ item }}</view
+          >
         </view>
+        <text v-else style="font-weight: 500; font-size: 14px; color: #666666"
+          >暂无</text
+        >
+      </view>
+      <view class="descript-box">
+        <text class="title-min">自我介绍</text>
+        <text class="descript">{{ userInfo.remarks || "暂无" }}</text>
+      </view>
+      <view class="image-box">
+        <text class="title-min">照片墙</text>
+        <block v-if="userInfo.images.length">
+          <view
+            class="image"
+            v-for="item in userInfo.images"
+            :key="item.attachmentid"
+            @click="preview(item.url)"
+          >
+            <u--image
+              width="100%"
+              :lazy-load="true"
+              :src="item.url"
+              radius="5"
+            ></u--image>
+          </view>
+        </block>
+        <text v-else style="font-weight: 500; font-size: 14px; color: #666666"
+          >暂无</text
+        >
+      </view>
+    </view>
 
-        <u-popup :show="shareShow" mode="bottom" @close="shareShow = false">
-            <view class="share-box">
-                <contact openType="share">
-                    <view class="item" hover-class="navigator-hover" @click="shareWx">
-                        <image mode="widthFix" src="/static/workbench/微信好友.svg" />
-                        <text>微信好友</text>
-                    </view>
-                </contact>
-
-                <navigator class="item" :url="'/cloud/businessCard/share?id=' + userid">
-                    <image mode="widthFix" src="/static/workbench/名片海报.svg" />
-                    <text>名片海报</text>
-                </navigator>
-            </view>
-        </u-popup>
+    <view class="footer2">
+      <navigator
+        class="but"
+        :url="'/cloud/businessCard/edit?id=' + userid"
+        @click="goEditPage"
+      >
+        <text>修改名片</text>
+      </navigator>
     </view>
+
+    <u-popup :show="shareShow" mode="bottom" @close="shareShow = false">
+      <view class="share-box">
+        <contact openType="share">
+          <view class="item" hover-class="navigator-hover" @click="shareWx">
+            <image mode="widthFix" src="/static/workbench/微信好友.svg" />
+            <text>微信好友</text>
+          </view>
+        </contact>
+
+        <navigator class="item" :url="'/cloud/businessCard/share?id=' + userid">
+          <image mode="widthFix" src="/static/workbench/名片海报.svg" />
+          <text>名片海报</text>
+        </navigator>
+      </view>
+    </u-popup>
+  </view>
 </template>
 
 <script>
-import contact from "../../components/contact"
-import { viewImage } from "../../utils/settleFiles.js"
+import contact from "../../components/contact";
+import { viewImage } from "../../utils/settleFiles.js";
+import { winTheCustomer } from "../../utils/share";
 export default {
-    components: { contact },
-    data() {
-        return {
-            userInfo: { tag: [], images: [] ,readusers:[]},
-            userid: uni.getStorageSync('userMsg').userid,
-            shareShow: false
-        }
+  components: { contact },
+  data() {
+    return {
+      userInfo: { tag: [], images: [], readusers: [] },
+      userid: uni.getStorageSync("userMsg").userid,
+      shareShow: false,
+    };
+  },
+  onUnload() {
+    delete this.$Http.refreshUserInfoData;
+  },
+  methods: {
+    preview(url) {
+      viewImage(url);
     },
-    computed: {
+    goEditPage() {
+      this.$Http.editUser = function (id) {
+        this.getuserInfo(id);
+        delete this.$Http.editUser;
+      }.bind(this);
     },
-    onUnload () {
-        delete this.$Http.refreshUserInfoData
-    },
-    methods: {
-        preview(url) {
-            viewImage(url)
-        },
-        goEditPage() {
-            this.$Http.editUser = function (id) {
-                this.getuserInfo(id)
-                delete this.$Http.editUser
-            }.bind(this)
+    async getuserInfo(id) {
+      let res = await this.$Http.basic({
+        id: 20240514161502,
+        content: {
+          userid: id,
         },
-        async getuserInfo(id) {
-            let res = await this.$Http.basic({
-                "id": 20240514161502,
-                "content": {
-                    userid: id
-                },
-            })
-            if (this.cutoff(res.msg)) return
-            this.userInfo = res.data
-            this.userInfo.headpic = this.userInfo.attinfos.find(v => v.usetype == "headportrait") && this.userInfo.attinfos.find(v => v.usetype == "headportrait").url || '';
-            this.userInfo.images = this.userInfo.attinfos.filter(v => v.usetype != "headportrait")
-            console.log(this.userInfo, '用户信息');
-        },
-        shareClick() {
-            this.shareShow = true
-        },
-        onBack() {
-            let curPages = getCurrentPages()
-            if (curPages.length == 1) {
-                uni.redirectTo({
-                    url:'/pages/index/index',
-                })
-            } else {
-                uni.navigateBack()
-            }
-        },
-        async goodClick() {
-            let res = await this.$Http.basic({
-                "id": 20240416133702,
-                "content": {
-                    "ownertable": "sys_users",
-                    "ownerid": this.userid,
-                    "type": 2//1:收藏,2:点赞
-                },
-            })
-            if (this.cutoff(res.msg)) return;
-            this.getuserInfo(this.userid)
-        },
-        copy() {
-            uni.setClipboardData({
-                data: this.userInfo.phonenumber,
-                success: (result) => {
-                    uni.showToast({
-                        title: "已复制",
-                        icon: "none",
-                        duration: 1500,
-                    })
-                }
-            });
-        }
+      });
+      if (this.cutoff(res.msg)) return;
+      this.userInfo = res.data;
+      this.userInfo.headpic =
+        (this.userInfo.attinfos.find((v) => v.usetype == "headportrait") &&
+          this.userInfo.attinfos.find((v) => v.usetype == "headportrait")
+            .url) ||
+        "";
+      this.userInfo.images = this.userInfo.attinfos.filter(
+        (v) => v.usetype != "headportrait"
+      );
+      console.log(this.userInfo, "用户信息");
     },
-    onShareAppMessage(res) {
-        return {
-            title: this.userInfo.name, // 标题
-            path: "/cloud/businessCard/index?id=" + this.userid, // 分享路径
-            imageUrl: ""// 分享图
-        };
+    shareClick() {
+      this.shareShow = true;
     },
-    onLoad(options) {
-        this.isInitializeLogin(render.bind(this))
-        function render() {
-            if (options.q) {
-                let params = this.getUrlParams(options.q);
-                user.wechatBindUserid = params.userid;
-                this.userid = params.userid
-            }
-            this.getuserInfo(this.userid)
-        }
+    onBack() {
+      let curPages = getCurrentPages();
+      if (curPages.length == 1) {
+        uni.redirectTo({
+          url: "/pages/index/index",
+        });
+      } else {
+        uni.navigateBack();
+      }
     },
-}
+    async goodClick() {
+      let res = await this.$Http.basic({
+        id: 20240416133702,
+        content: {
+          ownertable: "sys_users",
+          ownerid: this.userid,
+          type: 2, //1:收藏,2:点赞
+        },
+      });
+      if (this.cutoff(res.msg)) return;
+      this.getuserInfo(this.userid);
+    },
+    copy() {
+      uni.setClipboardData({
+        data: this.userInfo.phonenumber,
+        success: (result) => {
+          uni.showToast({
+            title: "已复制",
+            icon: "none",
+            duration: 1500,
+          });
+        },
+      });
+    },
+  },
+  onShareAppMessage(res) {
+    return {
+      title: this.userInfo.name,
+      path:
+        "/cloud/businessCard/index?id=" +
+        this.userid +
+        "&shareUserid=" +
+        this.shareUserid,
+      imageUrl: "",
+    };
+  },
+  onLoad(options) {
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      if (options.q) {
+        let params = this.getUrlParams(options.q);
+        this.userid = params.userid;
+      }
+      this.getuserInfo(this.userid);
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "个人名片");
+    }
+  },
+};
 </script>
 
 <style lang="scss">
 .self-card {
-    .head {
-        position: relative;
-        width: 100vw;
+  .head {
+    position: relative;
+    width: 100vw;
 
-        .bg-bottom {
-            position: absolute;
-            bottom: -1px;
-            left: 0;
-            width: 100vw;
+    .bg-bottom {
+      position: absolute;
+      bottom: -1px;
+      left: 0;
+      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);
+      }
+    }
 
-        .custom {
-            position: absolute;
-            width: 100vw;
+    .card {
+      width: 355px;
+      height: 220px;
+      box-sizing: border-box;
+      background: #ffffff;
+      box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.16);
+      border-radius: 8px 8px 8px 8px;
+      position: absolute;
+      top: var(--height);
+      left: 10px;
+      padding: 20px;
+      font-family: Source Han Sans SC, Source Han Sans SC;
+
+      .header {
+        display: flex;
+        justify-content: space-between;
+        .left {
+          display: flex;
+          flex-direction: column;
+          justify-content: space-between;
+
+          .title {
             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);
-            }
-        }
 
-        .card {
-            width: 355px;
-            height: 220px;
-            box-sizing: border-box;
-            background: #FFFFFF;
-            box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.16);
-            border-radius: 8px 8px 8px 8px;
-            position: absolute;
-            top: var(--height);
-            left: 10px;
-            padding: 20px;
-            font-family: Source Han Sans SC, Source Han Sans SC;
-
-            .header {
-                display: flex;
-                justify-content: space-between;
-                .left {
-                    display: flex;
-                    flex-direction: column;
-                    justify-content: space-between;
-
-                    .title {
-                        display: flex;
-                        align-items: center;
-
-                        text {
-                            &:first-child {
-                                font-weight: 500;
-                                font-size: 18px;
-                                color: #333333;
-                            }
-
-                            &:last-child {
-                                font-weight: 400;
-                                font-size: 12px;
-                                color: #999999;
-                                margin-left: 10px;
-                            }
-                        }
-
-                        margin-bottom: 5px;
-                    }
-
-                    .phone {
-                        font-weight: 500;
-                        font-size: 16px;
-                        color: #333333;
-                    }
-
-                    .redline {
-                        width: 24px;
-                        height: 2px;
-                        background: #C30D23;
-                        margin-top: 15px;
-                    }
-                }
-
-                .right {
-                    width: 56px;
-                    height: 56px;
-                    background: #DCEBF8;
-                    box-shadow: 0px 3px 6px 1px #E0D6D7;
-                    border: 2px solid #FFFFFF;
-                    border-radius: 50%;
-                    image {
-                        width: 100%;
-                        height: 100%;
-                        border-radius: 50%;
-                    }
-                }
-            }
+            text {
+              &:first-child {
+                font-weight: 500;
+                font-size: 18px;
+                color: #333333;
+              }
 
-            .bottom {
-                display: flex;
-                justify-content: space-between;
-                align-items: flex-start;
-                font-family: Source Han Sans SC, Source Han Sans SC;
+              &:last-child {
                 font-weight: 400;
                 font-size: 12px;
-                color: #666666;
-                margin-top: 22px;
-
-                .left {
-                    display: flex;
-                    flex-direction: column;
-
-                    >view {
-                        margin-bottom: 13px;
-                        display: flex;
-                        align-content: center;
-                        align-items: center;
-
-                        i {
-                            font-size: 16px;
-                        }
-
-                        .text {
-                            margin-left: 10px;
-                            max-width: 211px;
-                        }
-                    }
-                }
-
-                .right {
-                    display: flex;
-                    flex-direction: column;
-                    align-items: center;
-                    align-content: center;
-                    padding: 3px;
-                    border-radius: 5px;
-                    text {
-                        font-weight: 400;
-                        font-size: 12px;
-                        color: #666666;
-
-                    }
-
-                    .code {
-                        width: 32px;
-                        height: 32px;
-                        margin-bottom: 4px;
-                    }
-                }
+                color: #999999;
+                margin-left: 10px;
+              }
             }
+
+            margin-bottom: 5px;
+          }
+
+          .phone {
+            font-weight: 500;
+            font-size: 16px;
+            color: #333333;
+          }
+
+          .redline {
+            width: 24px;
+            height: 2px;
+            background: #c30d23;
+            margin-top: 15px;
+          }
         }
-    }
 
-    .card-handle {
-        padding: 50px 10px 20px 10px;
-        background: #ffffff;
-        margin-top: 15px;
+        .right {
+          width: 56px;
+          height: 56px;
+          background: #dcebf8;
+          box-shadow: 0px 3px 6px 1px #e0d6d7;
+          border: 2px solid #ffffff;
+          border-radius: 50%;
+          image {
+            width: 100%;
+            height: 100%;
+            border-radius: 50%;
+          }
+        }
+      }
 
-        .top {
+      .bottom {
+        display: flex;
+        justify-content: space-between;
+        align-items: flex-start;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-weight: 400;
+        font-size: 12px;
+        color: #666666;
+        margin-top: 22px;
+
+        .left {
+          display: flex;
+          flex-direction: column;
+
+          > view {
+            margin-bottom: 13px;
             display: flex;
-            justify-content: space-between;
-            align-items: center;
             align-content: center;
-            font-family: Source Han Sans SC, Source Han Sans SC;
-            font-size: 12px;
-            color: #999999;
-
-            .left {
-                display: flex;
-                flex-direction: column;
-
-                .avatar {
-                    display: flex;
-                    align-items: flex-start;
-                    align-content: center;
-
-                    image {
-                        margin-right: 5px;
-                        width: 24px;
-                        height: 24px;
-                        border-radius: 50%;
-                    }
-
-                    text {
-                        transform: scale(1.5);
-                    }
-                }
-
-                .readcount {
-                    margin-top: 5px;
-                    display: block;
-                }
+            align-items: center;
+
+            i {
+              font-size: 16px;
             }
 
-            .right {
-                display: flex;
-                flex-direction: column;
-                align-content: center;
-                align-items: center;
-                width: 35px;
-                height: 40px;
-                border-radius: 3px;
-                i {
-                    display: block;
-                    color: #666666;
-                }
-
-                text {
-                    margin-top: 5px;
-                    display: block;
-                }
+            .text {
+              margin-left: 10px;
+              max-width: 211px;
             }
+          }
         }
 
-        .bottom {
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            align-content: center;
-            margin-top: 25px;
-
-            .but {
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                box-sizing: border-box;
-                border-radius: 8px 8px 8px 8px;
-                font-family: Source Han Sans SC, Source Han Sans SC;
-                font-weight: 400;
-                font-size: 16px;
-                width: 173px;
-                height: 50px;
-                line-height: 50px;
-                text-align: center;
-
-                &:nth-child(1) {
-                    background: #FFFFFF;
-                    border: 1px solid #CCCCCC;
-                    color: #666666;
-                }
-
-                &:nth-child(2) {
-                    background: #C30D23;
-                    color: #FFFFFF;
-                }
-
-                view {
-                    margin-right: 10px;
-                }
-            }
+        .right {
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+          align-content: center;
+          padding: 3px;
+          border-radius: 5px;
+          text {
+            font-weight: 400;
+            font-size: 12px;
+            color: #666666;
+          }
+
+          .code {
+            width: 32px;
+            height: 32px;
+            margin-bottom: 4px;
+          }
         }
+      }
     }
+  }
+
+  .card-handle {
+    padding: 50px 10px 20px 10px;
+    background: #ffffff;
+    margin-top: 15px;
+
+    .top {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      align-content: center;
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-size: 12px;
+      color: #999999;
+
+      .left {
+        display: flex;
+        flex-direction: column;
 
-    .user-info {
-        padding: 12px 10px 70px 10px;
-        font-family: PingFang SC, PingFang SC;
-        background: #ffffff;
-        margin-top: 10px;
+        .avatar {
+          display: flex;
+          align-items: flex-start;
+          align-content: center;
+
+          image {
+            margin-right: 5px;
+            width: 24px;
+            height: 24px;
+            border-radius: 50%;
+          }
+
+          text {
+            transform: scale(1.5);
+          }
+        }
 
-        .title-min {
-            margin-bottom: 10px;
-            font-weight: 500;
-            font-size: 14px;
-            color: #666666;
-            display: block;
+        .readcount {
+          margin-top: 5px;
+          display: block;
         }
+      }
 
-        .title-max {
-            margin-bottom: 21px;
-            font-weight: 500;
-            font-size: 16px;
-            color: #333333;
-            display: block;
+      .right {
+        display: flex;
+        flex-direction: column;
+        align-content: center;
+        align-items: center;
+        width: 35px;
+        height: 40px;
+        border-radius: 3px;
+        i {
+          display: block;
+          color: #666666;
         }
 
-        .tag-box {
-            display: flex;
-            flex-direction: column;
-            margin-bottom: 20px;
-
-            .title-min {}
-
-            .tag-list {
-                display: flex;
-                align-content: center;
-                align-items: center;
-                flex-wrap: wrap;
-
-                .tag {
-                    margin-right: 10px;
-                    padding: 6px 10px;
-                    background: #F2F2F2;
-                    border-radius: 5px 5px 5px 5px;
-                    margin-right: 10px;
-                    font-weight: 400;
-                    font-size: 14px;
-                    color: #333333;
-
-                    &:last-child {
-                        margin-right: 0;
-                    }
-                }
-            }
+        text {
+          margin-top: 5px;
+          display: block;
         }
+      }
+    }
 
-        .descript-box {
-            margin-bottom: 20px;
-            display: flex;
-            flex-direction: column;
+    .bottom {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      align-content: center;
+      margin-top: 25px;
 
-            .descript {
-                font-weight: 400;
-                font-size: 14px;
-                color: #666666;
-            }
+      .but {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        box-sizing: border-box;
+        border-radius: 8px 8px 8px 8px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-weight: 400;
+        font-size: 16px;
+        width: 173px;
+        height: 50px;
+        line-height: 50px;
+        text-align: center;
+
+        &:nth-child(1) {
+          background: #ffffff;
+          border: 1px solid #cccccc;
+          color: #666666;
         }
 
-        .image-box {
-            display: flex;
-            flex-direction: column;
+        &:nth-child(2) {
+          background: #c30d23;
+          color: #ffffff;
+        }
 
-            .image {
-                width: 100%;
-                height: 240px;
-                margin-bottom: 10px;
-            }
+        view {
+          margin-right: 10px;
         }
+      }
+    }
+  }
+
+  .user-info {
+    padding: 12px 10px 70px 10px;
+    font-family: PingFang SC, PingFang SC;
+    background: #ffffff;
+    margin-top: 10px;
+
+    .title-min {
+      margin-bottom: 10px;
+      font-weight: 500;
+      font-size: 14px;
+      color: #666666;
+      display: block;
     }
 
-    .footer {
-        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: 9;
-        padding: 5px 10px;
+    .title-max {
+      margin-bottom: 21px;
+      font-weight: 500;
+      font-size: 16px;
+      color: #333333;
+      display: block;
+    }
 
-        .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);
-            }
-        }
+    .tag-box {
+      display: flex;
+      flex-direction: column;
+      margin-bottom: 20px;
 
-        .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;
+      .title-min {
+      }
+
+      .tag-list {
+        display: flex;
+        align-content: center;
+        align-items: center;
+        flex-wrap: wrap;
+
+        .tag {
+          margin-right: 10px;
+          padding: 6px 10px;
+          background: #f2f2f2;
+          border-radius: 5px 5px 5px 5px;
+          margin-right: 10px;
+          font-weight: 400;
+          font-size: 14px;
+          color: #333333;
+
+          &:last-child {
+            margin-right: 0;
+          }
         }
+      }
     }
-}
 
-.footer2 {
+    .descript-box {
+      margin-bottom: 20px;
+      display: flex;
+      flex-direction: column;
+
+      .descript {
+        font-weight: 400;
+        font-size: 14px;
+        color: #666666;
+      }
+    }
+
+    .image-box {
+      display: flex;
+      flex-direction: column;
+
+      .image {
+        width: 100%;
+        height: 240px;
+        margin-bottom: 10px;
+      }
+    }
+  }
+
+  .footer {
+    display: flex;
     position: fixed;
     bottom: 0;
-    width: 100vw;
-    height: 65px;
-    background: #FFFFFF;
+    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: 9;
     padding: 5px 10px;
-    display: flex;
 
-    .but {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        width: 100%;
-        height: 45px;
-        background: #C30D23;
-        border-radius: 5px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 14px;
-        color: #FFFFFF;
+    .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);
+      }
     }
 
-    .forbidden {
-        opacity: .6;
+    .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;
     }
+  }
+}
+
+.footer2 {
+  position: fixed;
+  bottom: 0;
+  width: 100vw;
+  height: 65px;
+  background: #ffffff;
+  box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+  box-sizing: border-box;
+  padding: 5px 10px;
+  display: flex;
+
+  .but {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 45px;
+    background: #c30d23;
+    border-radius: 5px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 14px;
+    color: #ffffff;
+  }
+
+  .forbidden {
+    opacity: 0.6;
+  }
 }
 
 .share-box {
-    padding: 30px 0;
+  padding: 30px 0;
+  display: flex;
+  align-items: center;
+  align-content: center;
+  justify-content: space-evenly;
+
+  .item {
     display: flex;
+    flex-direction: column;
     align-items: center;
     align-content: center;
-    justify-content: space-evenly;
-
-    .item {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-        align-content: center;
-        border-radius: 5px;
-        image {
-            width: 50px;
-            height: 50px;
-        }
+    border-radius: 5px;
+    image {
+      width: 50px;
+      height: 50px;
+    }
 
-        text {
-            margin-top: 5px;
-            font-family: Source Han Sans SC, Source Han Sans SC;
-            font-weight: 400;
-            font-size: 12px;
-            color: #333333;
-        }
+    text {
+      margin-top: 5px;
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-weight: 400;
+      font-size: 12px;
+      color: #333333;
     }
+  }
 }
 </style>

+ 327 - 171
cloud/businessCard/share.vue

@@ -1,194 +1,350 @@
 <template>
-    <view class="card-box">
-        <lPainter ref="painter" css="position:relative;">
-            <lPainterView :css="'background:#ffffff;border-radius:'+tovw(8)+';width:'+tovw(280)+';height:'+tovw(463)">
-                <lPainterImage :src="imageUrl" :css="'width:'+tovw(280)+';height:'+tovw(200)+';border-radius:'+tovw(8)" object-fit="fill" />
+  <view class="card-box">
+    <lPainter ref="painter" css="position:relative;">
+      <lPainterView
+        :css="
+          'background:#ffffff;border-radius:' +
+          tovw(8) +
+          ';width:' +
+          tovw(280) +
+          ';height:' +
+          tovw(463)
+        "
+      >
+        <lPainterImage
+          :src="imageUrl"
+          :css="
+            'width:' +
+            tovw(280) +
+            ';height:' +
+            tovw(200) +
+            ';border-radius:' +
+            tovw(8)
+          "
+          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.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'" :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="
+            '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.headpic ||
+                'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'
+              "
+              :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(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="
+              '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>
-        
+          <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"
+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:'',
-            qrCode: this.qrCodePrefix,
-            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,
-                                })
-                            }
-                        },
+  components: {
+    lPainter,
+    lPainterView,
+    lPainterText,
+    lPainterImage,
+    lPainterQrcode,
+  },
+  data() {
+    return {
+      userInfo: {},
+      userid: "",
+      imageUrl: "",
+      qrCode: this.qrCodePrefix,
+      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
-                },
-            })
-            if (this.cutoff(res.msg)) return;
-            this.userInfo = res.data
-            this.userInfo.headpic = this.userInfo.attinfos.find(v => v.usetype == "headportrait") && this.userInfo.attinfos.find(v => v.usetype == "headportrait").url || '';
-            console.log(this.userInfo,'用户信息');
+      });
+    },
+    async getuserInfo(id) {
+      let res = await this.$Http.basic({
+        id: 20240514161502,
+        content: {
+          userid: this.userid,
         },
-        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,'海报广告图');
-        }  
+      });
+      if (this.cutoff(res.msg)) return;
+      this.userInfo = res.data;
+      this.userInfo.headpic =
+        (this.userInfo.attinfos.find((v) => v.usetype == "headportrait") &&
+          this.userInfo.attinfos.find((v) => v.usetype == "headportrait")
+            .url) ||
+        "";
+      console.log(this.userInfo, "用户信息");
     },
-    onLoad (option) {
-        this.userid = option.id
-        this.getImages()
-        this.getuserInfo()
+    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, "海报广告图");
     },
-    onShareAppMessage(res) {
-        return {
-            title:this.userInfo.name+'的名片',
-            path:'/cloud/businessCard/share?id='+this.userInfo.userid
-        }
-    }
-}
+  },
+  onLoad(option) {
+    this.userid = option.id;
+    this.getImages();
+    this.getuserInfo();
+  },
+  onShareAppMessage(res) {
+    return {
+      title: this.userInfo.name + "的名片",
+      path:
+        "/cloud/businessCard/index?id=" +
+        this.userid +
+        "&shareUserid=" +
+        this.userid,
+    };
+  },
+};
 </script>
 
 <style lang="scss">
 .card-box {
-    width:280px;
-    height: 463px;
-    margin: 20px auto 0 auto;
+  width: 280px;
+  height: 463px;
+  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;
-    .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;
-        }
+    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>

+ 5 - 6
packageA/advertising/shareable.vue

@@ -27,15 +27,14 @@ export default {
   },
   methods: {
     getSheraDate() {
-      let detail = this.detail,
-        path =
+      let detail = this.detail;
+      return {
+        title: detail.title, // 标题
+        path:
           "/packageA/advertising/shareable?id=" +
           detail.sat_sharematerialid +
           "&shareUserid=" +
-          this.shareUserid;
-      return {
-        title: detail.title, // 标题
-        path, // 分享路径
+          this.shareUserid, // 分享路径
         imageUrl: "", // 分享图
       };
     },

+ 403 - 336
packageCase/imgs/detail.vue

@@ -1,384 +1,451 @@
 <template>
-    <view>
-
-        <swiper class="swiper" circular v-if="slides.length" :indicator-dots="slides.length > 1" indicator-color="#DC808B"
-            indicator-active-color="#C30D23">
-            <swiper-item class="swiper-item" v-for="item in slides" :key="item.url">
-                <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
-                <view class="qrcode" @click="saveQrcode">
-                    <text class="iconfont icon-xiazai" />
-                    二维码
-                </view>
-            </swiper-item>
-        </swiper>
-        <view class="head">
-            <view class="line1">
-                <view class="left">
-                    <text class="iconfont icon-biaoqian" />
-                    {{ detail.renderingstype }}
-                </view>
-                <view class="right" hover-class="navigator-hover"
-                    @click="collectLoading ? '' : handleCollect(detail.iscollect)">
-                    <u-loading-icon v-if="collectLoading" size="20" />
-                    <block v-else>
-                        <text v-if="detail.iscollect == 0" class="iconfont icon-weishoucang" />
-                        <text v-else class="iconfont icon-yishoucang" style="color: #FFC300;" />
-                        收藏
-                    </block>
-                </view>
-            </view>
-            <view class="title">{{ detail.title }}</view>
-            <view class="subtitle" v-if="detail.subtitle">{{ detail.subtitle }}</view>
+  <view>
+    <swiper
+      class="swiper"
+      circular
+      v-if="slides.length"
+      :indicator-dots="slides.length > 1"
+      indicator-color="#DC808B"
+      indicator-active-color="#C30D23"
+    >
+      <swiper-item class="swiper-item" v-for="item in slides" :key="item.url">
+        <image
+          class="image"
+          :src="item.cover"
+          mode="aspectFill"
+          lazy-load="true"
+        />
+        <view class="qrcode" @click="saveQrcode">
+          <text class="iconfont icon-xiazai" />
+          二维码
         </view>
-
-
-        <scroll-view v-if="productList.length" class="product-list" scroll-x lower-threshold="200" enable-flex
-            @scrolltolower="scrolltolower">
-            <navigator class="product" v-for="item in productList" :key="item.sa_fadid"
-                :url="'/packageCase/product/detail?id=' + item.sa_fadid" hover-class="navigator-hover">
-                <u--image :src="item.cover" :lazy-load="true" :width="tovw(112)" :height="tovw(112)" radius="5">
-                    <template v-slot:loading>
-                        <u-loading-icon color="red"></u-loading-icon>
-                    </template>
-                </u--image>
-                <view class="label u-line-1">
-                    {{ item.name }}
-                </view>
-            </navigator>
-        </scroll-view>
-
-
-        <view class="introduce" v-if="detail.notes">
-            <view class="introduce-title">
-                产品介绍
-            </view>
-            <view class="introduce-text">
-                {{ detail.notes }}
-            </view>
+      </swiper-item>
+    </swiper>
+    <view class="head">
+      <view class="line1">
+        <view class="left">
+          <text class="iconfont icon-biaoqian" />
+          {{ detail.renderingstype }}
         </view>
-        <storeInfo />
-        <view style="position: absolute;z-index: -999;top: 0;">
-            <l-painter ref="painter" hidden css="padding:10px;background:#fff;width: 148px;">
-                <l-painter-view>
-                    <l-painter-view css="margin: 0 auto;width: 128px;">
-                        <l-painter-qrcode :text="detail.appleturl" css="width: 128px; height: 128px;color:#000;" />
-                    </l-painter-view>
-                    <l-painter-view css="width: 108px;text-align: center;margin: 10px auto 0;">
-                        <l-painter-text :text="detail.title" />
-                    </l-painter-view>
-                </l-painter-view>
-            </l-painter>
+        <view
+          class="right"
+          hover-class="navigator-hover"
+          @click="collectLoading ? '' : handleCollect(detail.iscollect)"
+        >
+          <u-loading-icon v-if="collectLoading" size="20" />
+          <block v-else>
+            <text
+              v-if="detail.iscollect == 0"
+              class="iconfont icon-weishoucang"
+            />
+            <text
+              v-else
+              class="iconfont icon-yishoucang"
+              style="color: #ffc300"
+            />
+            收藏
+          </block>
         </view>
-        <bottomForm type="效果图" ownertable="sat_sharematerial" :ownerid="sat_sharematerialid" />
+      </view>
+      <view class="title">{{ detail.title }}</view>
+      <view class="subtitle" v-if="detail.subtitle">{{ detail.subtitle }}</view>
     </view>
+
+    <scroll-view
+      v-if="productList.length"
+      class="product-list"
+      scroll-x
+      lower-threshold="200"
+      enable-flex
+      @scrolltolower="scrolltolower"
+    >
+      <navigator
+        class="product"
+        v-for="item in productList"
+        :key="item.sa_fadid"
+        :url="'/packageCase/product/detail?id=' + item.sa_fadid"
+        hover-class="navigator-hover"
+      >
+        <u--image
+          :src="item.cover"
+          :lazy-load="true"
+          :width="tovw(112)"
+          :height="tovw(112)"
+          radius="5"
+        >
+          <template v-slot:loading>
+            <u-loading-icon color="red"></u-loading-icon>
+          </template>
+        </u--image>
+        <view class="label u-line-1">
+          {{ item.name }}
+        </view>
+      </navigator>
+    </scroll-view>
+
+    <view class="introduce" v-if="detail.notes">
+      <view class="introduce-title"> 产品介绍 </view>
+      <view class="introduce-text">
+        {{ detail.notes }}
+      </view>
+    </view>
+    <storeInfo />
+    <view style="position: absolute; z-index: -999; top: 0">
+      <l-painter
+        ref="painter"
+        hidden
+        css="padding:10px;background:#fff;width: 148px;"
+      >
+        <l-painter-view>
+          <l-painter-view css="margin: 0 auto;width: 128px;">
+            <l-painter-qrcode
+              :text="detail.appleturl"
+              css="width: 128px; height: 128px;color:#000;"
+            />
+          </l-painter-view>
+          <l-painter-view
+            css="width: 108px;text-align: center;margin: 10px auto 0;"
+          >
+            <l-painter-text :text="detail.title" />
+          </l-painter-view>
+        </l-painter-view>
+      </l-painter>
+    </view>
+    <bottomForm
+      type="效果图"
+      ownertable="sat_sharematerial"
+      :ownerid="sat_sharematerialid"
+    />
+  </view>
 </template>
 
 <script>
-import lPainter from "../../uni_modules/lime-painter/components/l-painter/l-painter.vue"
-import lPainterText from "../../uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue"
-import lPainterView from "../../uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue"
-import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue"
+import { winTheCustomer } from "../../utils/share";
+import lPainter from "../../uni_modules/lime-painter/components/l-painter/l-painter.vue";
+import lPainterText from "../../uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue";
+import lPainterView from "../../uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue";
+import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue";
 export default {
-    components: { lPainter, lPainterQrcode, lPainterText, lPainterView },
-    data() {
-        return {
-            sat_sharematerialid: null,
-            detail: {},
-            slides: [],
-            collectLoading: false,
-            content: {
-                "pageNumber": 1,
-                "pageTotal": 1,
-                "pageSize": 20,
-                "where": {
-                    "condition": ""
-                }
-            },
-            productList: []
-        }
-    },
-    onLoad(options) {
-        this.sat_sharematerialid = options.id;
-        this.getDetail(true);
-        this.scrolltolower()
-    },
-    methods: {
-        getDetail(init = false) {
-            if (!init) return;
-            this.$Http.basic({
-                "id": 20240415164302,
-                "content": {
-                    "sat_sharematerialid": this.sat_sharematerialid
-                },
-            }).then(res => {
-                console.log("获取效果图详情", res)
-                if (this.cutoff(res.msg)) return;
-                this.detail = res.data;
-                this.slides = res.data.attinfos_pic.map(v => {
-                    return {
-                        cover: this.getSpecifiedImage(v.attinfos[0], 'compressed'),
-                        url: v.attinfos[0].url
-                    }
-                })
-                uni.setNavigationBarTitle({
-                    title: res.data.title
-                });
-            })
-        },
-        handleCollect(iscollect) {
-            this.collectLoading = true;
-            this.$Http.basic({
-                "id": 20240416133702,
-                "content": {
-                    "ownertable": "sat_sharematerial",
-                    "ownerid": this.detail.sat_sharematerialid,
-                    "type": 1
-                },
-            }).then(res => {
-                console.log("收藏", res)
-                this.collectLoading = false;
-                if (this.cutoff(res.msg)) return;
-                this.detail.iscollect = iscollect ? 0 : 1
-            })
-        },
-        saveQrcode() {
-            let that = this;
-            that.$refs.painter.canvasToTempFilePathSync({
-                fileType: "jpg",
-                // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
-                pathType: 'url',
-                quality: 1,
-                success: (res) => {
-                    console.log(res.tempFilePath);
-                    // 非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,
-                                })
-                            }
-                        },
-                    });
-                },
-            });
+  components: { lPainter, lPainterQrcode, lPainterText, lPainterView },
+  data() {
+    return {
+      sat_sharematerialid: null,
+      detail: {},
+      slides: [],
+      collectLoading: false,
+      content: {
+        pageNumber: 1,
+        pageTotal: 1,
+        pageSize: 20,
+        where: {
+          condition: "",
         },
-        getSheraDate() {
-            let detail = this.detail
+      },
+      productList: [],
+    };
+  },
+  onLoad(options) {
+    this.sat_sharematerialid = options.id;
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      this.getDetail(true);
+      this.scrolltolower();
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "效果图");
+    }
+  },
+  methods: {
+    getDetail(init = false) {
+      if (!init) return;
+      this.$Http
+        .basic({
+          id: 20240415164302,
+          content: {
+            sat_sharematerialid: this.sat_sharematerialid,
+          },
+        })
+        .then((res) => {
+          console.log("获取效果图详情", res);
+          if (this.cutoff(res.msg)) return;
+          this.detail = res.data;
+          this.slides = res.data.attinfos_pic.map((v) => {
             return {
-                title: detail.title, // 标题
-                path: "/packageCase/imgs/detail?id=" + detail.sat_sharematerialid, // 分享路径
-                imageUrl: this.detail.attinfos.find(v => v.usetype == "sat_sharematerial").url || ""// 分享图
+              cover: this.getSpecifiedImage(v.attinfos[0], "compressed"),
+              url: v.attinfos[0].url,
             };
+          });
+          uni.setNavigationBarTitle({
+            title: res.data.title,
+          });
+        });
+    },
+    handleCollect(iscollect) {
+      this.collectLoading = true;
+      this.$Http
+        .basic({
+          id: 20240416133702,
+          content: {
+            ownertable: "sat_sharematerial",
+            ownerid: this.detail.sat_sharematerialid,
+            type: 1,
+          },
+        })
+        .then((res) => {
+          console.log("收藏", res);
+          this.collectLoading = false;
+          if (this.cutoff(res.msg)) return;
+          this.detail.iscollect = iscollect ? 0 : 1;
+        });
+    },
+    saveQrcode() {
+      let that = this;
+      that.$refs.painter.canvasToTempFilePathSync({
+        fileType: "jpg",
+        // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
+        pathType: "url",
+        quality: 1,
+        success: (res) => {
+          console.log(res.tempFilePath);
+          // 非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,
+                });
+              }
+            },
+          });
         },
-        scrolltolower() {
-            let content = this.content;
-            content.sat_sharematerialid = this.sat_sharematerialid;
-            if (content.pageNumber > content.pageTotal) return console.log("已加载全部单品")
-            this.$Http.basic({
-                "id": 20240419135802,
-                content
-            }).then(res => {
-                console.log("关联单品", res)
-                if (this.cutoff(res.msg)) return;
-                res.data = res.data.map(v => {
-                    v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sa_fad") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
-                    return v
-                })
-                this.productList = res.pageNumber == 1 ? res.data : this.productList.concat(res.data);
-                content.pageNumber = res.pageNumber + 1;
-                content.pageTotal = res.pageTotal;
-            })
-        }
+      });
     },
-    onShareAppMessage(res) {
-        return this.getSheraDate()
+    getSheraDate() {
+      let detail = this.detail;
+      return {
+        title: detail.title, // 标题
+        path:
+          "/packageCase/imgs/detail?id=" +
+          detail.sat_sharematerialid +
+          "&shareUserid=" +
+          this.shareUserid, // 分享路径
+        imageUrl:
+          this.detail.attinfos.find((v) => v.usetype == "sat_sharematerial")
+            .url || "", // 分享图
+      };
     },
-    onShareTimeline() {
-        return this.getSheraDate()
-    }
-}
+    scrolltolower() {
+      let content = this.content;
+      content.sat_sharematerialid = this.sat_sharematerialid;
+      if (content.pageNumber > content.pageTotal)
+        return console.log("已加载全部单品");
+      this.$Http
+        .basic({
+          id: 20240419135802,
+          content,
+        })
+        .then((res) => {
+          console.log("关联单品", res);
+          if (this.cutoff(res.msg)) return;
+          res.data = res.data.map((v) => {
+            v.cover = v.attinfos.length
+              ? this.getSpecifiedImage(
+                  v.attinfos.find((s) => s.usetype == "sa_fad") || v.attinfos[0]
+                )
+              : uni.getStorageSync("site").logo || "";
+            return v;
+          });
+          this.productList =
+            res.pageNumber == 1 ? res.data : this.productList.concat(res.data);
+          content.pageNumber = res.pageNumber + 1;
+          content.pageTotal = res.pageTotal;
+        });
+    },
+  },
+  onShareAppMessage(res) {
+    return this.getSheraDate();
+  },
+  onShareTimeline() {
+    return this.getSheraDate();
+  },
+};
 </script>
 
 <style lang="scss">
 .swiper {
-    width: 375px;
-    height: 231px;
-    background: #F5F5F5;
-    border-radius: 5px;
-    box-sizing: border-box;
+  width: 375px;
+  height: 231px;
+  background: #f5f5f5;
+  border-radius: 5px;
+  box-sizing: border-box;
 
-    .swiper-item {
-        position: relative;
-        width: 100%;
-        height: 100%;
+  .swiper-item {
+    position: relative;
+    width: 100%;
+    height: 100%;
 
-        .image {
-            width: 100%;
-            height: 100%;
-        }
-
-        .qrcode {
-            position: absolute;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            top: 10px;
-            right: 10px;
-            width: 70px;
-            height: 25px;
-            background: rgba($color: #333333, $alpha: 0.5);
-            font-size: 12px;
-            color: #FFFFFF;
-
-            .iconfont {
-                margin-right: 4px;
-            }
-        }
+    .image {
+      width: 100%;
+      height: 100%;
     }
 
+    .qrcode {
+      position: absolute;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      top: 10px;
+      right: 10px;
+      width: 70px;
+      height: 25px;
+      background: rgba($color: #333333, $alpha: 0.5);
+      font-size: 12px;
+      color: #ffffff;
 
+      .iconfont {
+        margin-right: 4px;
+      }
+    }
+  }
 }
 
 .head {
-    background: #fff;
-    padding: 8px 10px 15px;
-    margin-bottom: 10px;
+  background: #fff;
+  padding: 8px 10px 15px;
+  margin-bottom: 10px;
 
-    .line1 {
-        display: flex;
-        justify-content: space-between;
-        align-items: flex-end;
+  .line1 {
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-end;
 
-        .left {
-            .iconfont {
-                margin-right: 4px;
-                font-size: 12px;
-            }
+    .left {
+      .iconfont {
+        margin-right: 4px;
+        font-size: 12px;
+      }
 
-            line-height: 17px;
-            font-size: 12px;
-            color: #999999;
-        }
+      line-height: 17px;
+      font-size: 12px;
+      color: #999999;
+    }
 
-        .right {
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            width: 80px;
-            height: 24px;
-            border-radius: 12px;
-            border: 1px solid #CCCCCC;
-            font-family: PingFang SC, PingFang SC;
-            font-size: 12px;
-            color: #333333;
+    .right {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      width: 80px;
+      height: 24px;
+      border-radius: 12px;
+      border: 1px solid #cccccc;
+      font-family: PingFang SC, PingFang SC;
+      font-size: 12px;
+      color: #333333;
 
-            .iconfont {
-                margin-right: 5px;
-            }
-        }
+      .iconfont {
+        margin-right: 5px;
+      }
     }
+  }
 
-    .title {
-        line-height: 20px;
-        font-family: PingFang SC, PingFang SC;
-        font-weight: bold;
-        font-size: 14px;
-        color: #333333;
-        margin: 10px 0;
-    }
+  .title {
+    line-height: 20px;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: bold;
+    font-size: 14px;
+    color: #333333;
+    margin: 10px 0;
+  }
 
-    .subtitle {
-        line-height: 17px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 12px;
-        color: #666666;
-    }
+  .subtitle {
+    line-height: 17px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 12px;
+    color: #666666;
+  }
 }
 
 .product-list {
-    display: flex;
-    width: 100vw;
-    height: 162px;
-    white-space: nowrap;
-    box-sizing: border-box;
-    padding-top: 10px;
-    background: #fff;
-    margin-bottom: 10px;
+  display: flex;
+  width: 100vw;
+  height: 162px;
+  white-space: nowrap;
+  box-sizing: border-box;
+  padding-top: 10px;
+  background: #fff;
+  margin-bottom: 10px;
 
-    .product {
-        width: 112px;
-        height: 142px;
-        margin-left: 10px;
-        flex-shrink: 0;
-        background: #fff;
+  .product {
+    width: 112px;
+    height: 142px;
+    margin-left: 10px;
+    flex-shrink: 0;
+    background: #fff;
 
-        .label {
-            width: 112px;
-            line-height: 20px;
-            font-family: PingFang SC, PingFang SC;
-            font-size: 14px;
-            color: #333333;
-            margin-top: 10px;
-            white-space: Normal;
-        }
+    .label {
+      width: 112px;
+      line-height: 20px;
+      font-family: PingFang SC, PingFang SC;
+      font-size: 14px;
+      color: #333333;
+      margin-top: 10px;
+      white-space: Normal;
     }
+  }
 }
 
 .introduce {
-    background: #fff;
-    padding: 0 10px;
+  background: #fff;
+  padding: 0 10px;
 
-    &-title {
-        line-height: 45px;
-        background: #FFFFFF;
-        font-family: PingFang SC, PingFang SC;
-        font-weight: bold;
-        font-size: 16px;
-        color: #333333;
-    }
+  &-title {
+    line-height: 45px;
+    background: #ffffff;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: bold;
+    font-size: 16px;
+    color: #333333;
+  }
 
-    &-text {
-        line-height: 20px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 14px;
-        color: #333333;
-        padding-bottom: 10px;
-    }
+  &-text {
+    line-height: 20px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 14px;
+    color: #333333;
+    padding-bottom: 10px;
+  }
 }
 </style>

+ 309 - 269
packageCase/product/detail.vue

@@ -1,311 +1,351 @@
 <template>
-    <view>
-        <swiper class="swiper" v-if="slides.length" :indicator-dots="slides.length > 1" indicator-color="#DC808B"
-            indicator-active-color="#C30D23">
-            <swiper-item class="swiper-item" v-for="item in slides" :key="item.url">
-                <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
-                <view class="qrcode" @click="saveQrcode">
-                    <text class="iconfont icon-xiazai" />
-                    二维码
-                </view>
-            </swiper-item>
-        </swiper>
-        <view class="head">
-            <view class="line1">
-                <view class="left">
-                    <text class="iconfont icon-biaoqian" />
-                    {{ detail.mainclassnames }}
-                </view>
-                <view class="right" hover-class="navigator-hover"
-                    @click="collectLoading ? '' : handleCollect(detail.iscollect)">
-                    <u-loading-icon v-if="collectLoading" size="20" />
-                    <block v-else>
-                        <text v-if="detail.iscollect == 0" class="iconfont icon-weishoucang" />
-                        <text v-else class="iconfont icon-yishoucang" style="color: #FFC300;" />
-                        收藏
-                    </block>
-                </view>
-            </view>
-            <view class="title">{{ detail.name }}</view>
-            <view class="subtitle">型号:{{ detail.model || '--' }}</view>
-            <view class="subtitle">尺寸:{{ detail.spec || '--' }}</view>
-            <view class="subtitle">价格:{{ CNY(detail.price) || '--' }}</view>
+  <view>
+    <swiper
+      class="swiper"
+      v-if="slides.length"
+      :indicator-dots="slides.length > 1"
+      indicator-color="#DC808B"
+      indicator-active-color="#C30D23"
+    >
+      <swiper-item class="swiper-item" v-for="item in slides" :key="item.url">
+        <image
+          class="image"
+          :src="item.cover"
+          mode="aspectFill"
+          lazy-load="true"
+        />
+        <view class="qrcode" @click="saveQrcode">
+          <text class="iconfont icon-xiazai" />
+          二维码
         </view>
-        <view class="introduce">
-            <block v-if="detail.content">
-                <view class="introduce-title">
-                    产品介绍
-                </view>
-                <view class="introduce-text">
-                    <u-parse :content="detail.content" />
-                </view>
-            </block>
+      </swiper-item>
+    </swiper>
+    <view class="head">
+      <view class="line1">
+        <view class="left">
+          <text class="iconfont icon-biaoqian" />
+          {{ detail.mainclassnames }}
         </view>
-        <storeInfo />
-        <view style="position: absolute;z-index: -999;top: 0;">
-            <l-painter ref="painter" hidden css="padding:10px;background:#fff;width: 148px;">
-                <l-painter-view>
-                    <l-painter-view css="margin: 0 auto;width: 128px;">
-                        <l-painter-qrcode :text="detail.appleturl" css="width: 128px; height: 128px;color:#000;" />
-                    </l-painter-view>
-                    <l-painter-view css="width: 108px;text-align: center;margin: 10px auto 0;">
-                        <l-painter-text :text="detail.name" />
-                    </l-painter-view>
-                </l-painter-view>
-            </l-painter>
+        <view
+          class="right"
+          hover-class="navigator-hover"
+          @click="collectLoading ? '' : handleCollect(detail.iscollect)"
+        >
+          <u-loading-icon v-if="collectLoading" size="20" />
+          <block v-else>
+            <text
+              v-if="detail.iscollect == 0"
+              class="iconfont icon-weishoucang"
+            />
+            <text
+              v-else
+              class="iconfont icon-yishoucang"
+              style="color: #ffc300"
+            />
+            收藏
+          </block>
         </view>
-        <bottomForm type="产品" ownertable="sa_fad" :ownerid="sa_fadid" />
+      </view>
+      <view class="title">{{ detail.name }}</view>
+      <view class="subtitle">型号:{{ detail.model || "--" }}</view>
+      <view class="subtitle">尺寸:{{ detail.spec || "--" }}</view>
+      <view class="subtitle">价格:{{ CNY(detail.price) || "--" }}</view>
     </view>
+    <view class="introduce">
+      <block v-if="detail.content">
+        <view class="introduce-title"> 产品介绍 </view>
+        <view class="introduce-text">
+          <u-parse :content="detail.content" />
+        </view>
+      </block>
+    </view>
+    <storeInfo />
+    <view style="position: absolute; z-index: -999; top: 0">
+      <l-painter
+        ref="painter"
+        hidden
+        css="padding:10px;background:#fff;width: 148px;"
+      >
+        <l-painter-view>
+          <l-painter-view css="margin: 0 auto;width: 128px;">
+            <l-painter-qrcode
+              :text="detail.appleturl"
+              css="width: 128px; height: 128px;color:#000;"
+            />
+          </l-painter-view>
+          <l-painter-view
+            css="width: 108px;text-align: center;margin: 10px auto 0;"
+          >
+            <l-painter-text :text="detail.name" />
+          </l-painter-view>
+        </l-painter-view>
+      </l-painter>
+    </view>
+    <bottomForm type="产品" ownertable="sa_fad" :ownerid="sa_fadid" />
+  </view>
 </template>
 
 <script>
-import lPainter from "../../uni_modules/lime-painter/components/l-painter/l-painter.vue"
-import lPainterText from "../../uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue"
-import lPainterView from "../../uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue"
-import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue"
+import { winTheCustomer } from "../../utils/share";
+import lPainter from "../../uni_modules/lime-painter/components/l-painter/l-painter.vue";
+import lPainterText from "../../uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue";
+import lPainterView from "../../uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue";
+import lPainterQrcode from "../../uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue";
 export default {
-    components: { lPainter, lPainterQrcode, lPainterText, lPainterView },
-    data() {
-        return {
-            sa_fadid: null,
-            detail: {},
-            slides: [],
-            collectLoading: false
-        }
+  components: { lPainter, lPainterQrcode, lPainterText, lPainterView },
+  data() {
+    return {
+      sa_fadid: null,
+      detail: {},
+      slides: [],
+      collectLoading: false,
+    };
+  },
+  onLoad(options) {
+    this.sa_fadid = options.id;
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      this.getDetail(true);
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "单品");
+    }
+  },
+  methods: {
+    getDetail(init = false) {
+      if (!init) return;
+      this.$Http
+        .basic({
+          id: 20240418141002,
+          content: {
+            sa_fadid: this.sa_fadid,
+          },
+        })
+        .then((res) => {
+          console.log("获取单品详情", res);
+          if (this.cutoff(res.msg)) return;
+          this.detail = res.data;
+          this.slides = res.data.attinfos_pic.map((v) => {
+            return {
+              cover: this.getSpecifiedImage(v.attinfos[0], "compressed"),
+              url: v.attinfos[0].url,
+            };
+          });
+          uni.setNavigationBarTitle({
+            title: res.data.name,
+          });
+        });
     },
-    onLoad(options) {
-        this.sa_fadid = options.id;
-        this.getDetail(true);
+    handleCollect(iscollect) {
+      this.collectLoading = true;
+      this.$Http
+        .basic({
+          id: 20240416133702,
+          content: {
+            ownertable: "sa_fad",
+            ownerid: this.detail.sa_fadid,
+            type: 1,
+          },
+        })
+        .then((res) => {
+          console.log("收藏", res);
+          this.collectLoading = false;
+          if (this.cutoff(res.msg)) return;
+          this.detail.iscollect = iscollect ? 0 : 1;
+        });
     },
-    methods: {
-        getDetail(init = false) {
-            if (!init) return;
-            this.$Http.basic({
-                "id": 20240418141002,
-                "content": {
-                    "sa_fadid": this.sa_fadid
-                },
-            }).then(res => {
-                console.log("获取单品详情", res)
-                if (this.cutoff(res.msg)) return;
-                this.detail = res.data;
-                this.slides = res.data.attinfos_pic.map(v => {
-                    return {
-                        cover: this.getSpecifiedImage(v.attinfos[0], 'compressed'),
-                        url: v.attinfos[0].url
-                    }
-                })
-                uni.setNavigationBarTitle({
-                    title: res.data.name
+    saveQrcode() {
+      let that = this;
+      that.$refs.painter.canvasToTempFilePathSync({
+        fileType: "jpg",
+        // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
+        pathType: "url",
+        quality: 1,
+        success: (res) => {
+          console.log(res.tempFilePath);
+          // 非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,
+                          });
+                        }
+                      },
+                    });
+                  },
                 });
-            })
-        },
-        handleCollect(iscollect) {
-            this.collectLoading = true;
-            this.$Http.basic({
-                "id": 20240416133702,
-                "content": {
-                    "ownertable": "sa_fad",
-                    "ownerid": this.detail.sa_fadid,
-                    "type": 1
-                },
-            }).then(res => {
-                console.log("收藏", res)
-                this.collectLoading = false;
-                if (this.cutoff(res.msg)) return;
-                this.detail.iscollect = iscollect ? 0 : 1
-            })
+              } else {
+                that.loading = false;
+                uni.showModal({
+                  title: "提示",
+                  content: "已取消保存",
+                  showCancel: false,
+                });
+              }
+            },
+          });
         },
-        saveQrcode() {
-            let that = this;
-            that.$refs.painter.canvasToTempFilePathSync({
-                fileType: "jpg",
-                // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
-                pathType: 'url',
-                quality: 1,
-                success: (res) => {
-                    console.log(res.tempFilePath);
-                    // 非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,
-                                })
-                            }
-                        },
-                    });
-                },
-            });
-        }, getSheraDate() {
-            let detail = this.detail
-            return {
-                title: detail.name, // 标题
-                path: "/packageCase/product/detail?id=" + detail.sa_fadid, // 分享路径
-                imageUrl: this.detail.attinfos.find(v => v.usetype == "sa_fad").url || ""// 分享图
-            };
-        }
+      });
     },
-    onShareAppMessage(res) {
-        return this.getSheraDate()
+    getSheraDate() {
+      let detail = this.detail;
+      return {
+        title: detail.name, // 标题
+        path:
+          "/packageCase/product/detail?id=" +
+          detail.sa_fadid +
+          "&shareUserid=" +
+          this.shareUserid, // 分享路径
+        imageUrl:
+          this.detail.attinfos.find((v) => v.usetype == "sa_fad").url || "", // 分享图
+      };
     },
-    onShareTimeline() {
-        return this.getSheraDate()
-    }
-}
+  },
+  onShareAppMessage(res) {
+    return this.getSheraDate();
+  },
+  onShareTimeline() {
+    return this.getSheraDate();
+  },
+};
 </script>
 
 <style lang="scss">
 .swiper {
-    width: 375px;
-    height: 231px;
-    background: #F5F5F5;
-    border-radius: 5px;
-    box-sizing: border-box;
-
-    .swiper-item {
-        position: relative;
-        width: 100%;
-        height: 100%;
+  width: 375px;
+  height: 231px;
+  background: #f5f5f5;
+  border-radius: 5px;
+  box-sizing: border-box;
 
-        .image {
-            width: 100%;
-            height: 100%;
-        }
+  .swiper-item {
+    position: relative;
+    width: 100%;
+    height: 100%;
 
-        .qrcode {
-            position: absolute;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            top: 10px;
-            right: 10px;
-            width: 70px;
-            height: 25px;
-            background: rgba($color: #333333, $alpha: 0.5);
-            font-size: 12px;
-            color: #FFFFFF;
-
-            .iconfont {
-                margin-right: 4px;
-            }
-        }
+    .image {
+      width: 100%;
+      height: 100%;
     }
 
+    .qrcode {
+      position: absolute;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      top: 10px;
+      right: 10px;
+      width: 70px;
+      height: 25px;
+      background: rgba($color: #333333, $alpha: 0.5);
+      font-size: 12px;
+      color: #ffffff;
 
+      .iconfont {
+        margin-right: 4px;
+      }
+    }
+  }
 }
 
 .head {
-    background: #fff;
-    padding: 8px 10px 15px;
+  background: #fff;
+  padding: 8px 10px 15px;
 
-    .line1 {
-        display: flex;
-        justify-content: space-between;
-        align-items: flex-end;
+  .line1 {
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-end;
 
-        .left {
-            .iconfont {
-                margin-right: 4px;
-                font-size: 12px;
-            }
+    .left {
+      .iconfont {
+        margin-right: 4px;
+        font-size: 12px;
+      }
 
-            line-height: 17px;
-            font-size: 12px;
-            color: #999999;
-        }
+      line-height: 17px;
+      font-size: 12px;
+      color: #999999;
+    }
 
-        .right {
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            width: 80px;
-            height: 24px;
-            border-radius: 12px;
-            border: 1px solid #CCCCCC;
-            font-family: PingFang SC, PingFang SC;
-            font-size: 12px;
-            color: #333333;
+    .right {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      width: 80px;
+      height: 24px;
+      border-radius: 12px;
+      border: 1px solid #cccccc;
+      font-family: PingFang SC, PingFang SC;
+      font-size: 12px;
+      color: #333333;
 
-            .iconfont {
-                margin-right: 5px;
-            }
-        }
+      .iconfont {
+        margin-right: 5px;
+      }
     }
+  }
 
-    .title {
-        line-height: 20px;
-        font-family: PingFang SC, PingFang SC;
-        font-weight: bold;
-        font-size: 14px;
-        color: #333333;
-        margin: 10px 0;
-    }
+  .title {
+    line-height: 20px;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: bold;
+    font-size: 14px;
+    color: #333333;
+    margin: 10px 0;
+  }
 
-    .subtitle {
-        line-height: 17px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 12px;
-        color: #666666;
-        margin-top: 5px;
-    }
+  .subtitle {
+    line-height: 17px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 12px;
+    color: #666666;
+    margin-top: 5px;
+  }
 }
 
 .introduce {
-    background: #fff;
-    margin-top: 10px;
-    padding: 0 10px;
+  background: #fff;
+  margin-top: 10px;
+  padding: 0 10px;
 
-    &-title {
-        line-height: 45px;
-        background: #FFFFFF;
-        font-family: PingFang SC, PingFang SC;
-        font-weight: bold;
-        font-size: 16px;
-        color: #333333;
-    }
+  &-title {
+    line-height: 45px;
+    background: #ffffff;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: bold;
+    font-size: 16px;
+    color: #333333;
+  }
 
-    &-text {
-        line-height: 20px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 14px;
-        color: #333333;
-        padding-bottom: 10px;
-    }
+  &-text {
+    line-height: 20px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 14px;
+    color: #333333;
+    padding-bottom: 10px;
+  }
 }
 </style>

+ 149 - 139
store/budget/result.vue

@@ -1,162 +1,172 @@
 <template>
-    <view>
-        <view class="box">
-            <view class="title">
-                您的装修报价是:
-            </view>
+  <view>
+    <view class="box">
+      <view class="title"> 您的装修报价是: </view>
 
-            <view class="price-box">
-                <view class="price">
-                    {{ CNY(price.min, '') }}
-                </view>
-                <view class="link">
-                    ~
-                </view>
-                <view class="price">
-                    {{ CNY(price.max, '') }}
-                </view>
-                <view class="unit">
-                    元
-                </view>
-            </view>
+      <view class="price-box">
+        <view class="price">
+          {{ CNY(price.min, "") }}
         </view>
-        <bottomForm submitType="品质服务" :extrajson="extrajson" typemx="装修预算" />
+        <view class="link"> ~ </view>
+        <view class="price">
+          {{ CNY(price.max, "") }}
+        </view>
+        <view class="unit"> 元 </view>
+      </view>
     </view>
+    <bottomForm
+      submitType="品质服务"
+      :extrajson="extrajson"
+      typemx="装修预算"
+    />
+  </view>
 </template>
 
 <script>
+import { winTheCustomer } from "../../utils/share";
 export default {
-    data() {
-        return {
-            extrajson: {},
-            price: {
-                min: 0,
-                max: 0
-            },
-            sa_storeid: 0
-        }
-    },
-    onLoad(options) {
-        console.log("options", options)
-        let data = JSON.parse(options.data);
-        this.extrajson = data;
-        uni.setNavigationBarTitle({
-            title: '装修预算'
+  data() {
+    return {
+      extrajson: {},
+      price: {
+        min: 0,
+        max: 0,
+      },
+      sa_storeid: 0,
+    };
+  },
+  onLoad(options) {
+    console.log("options", options);
+    let data = JSON.parse(options.data);
+    this.extrajson = data;
+    uni.setNavigationBarTitle({
+      title: "装修预算",
+    });
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      this.calculate(
+        options.sa_storeid || uni.getStorageSync("shop").sa_storeid
+      );
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "装修预算");
+    }
+  },
+  methods: {
+    calculate(sa_storeid) {
+      this.$Http
+        .basic({
+          id: 20240515131702,
+          content: {
+            sa_storeid,
+          },
+        })
+        .then((res) => {
+          console.log("获取门店装修预算", res);
+          if (this.cutoff(res.msg)) return;
+          let extrajson = this.extrajson;
+          let obj = {
+            min: 0,
+            max: 0,
+          };
+          res.data.forEach((v) => {
+            switch (v.type) {
+              case "厨房":
+                obj.min += v.min_price * 6 * extrajson.bathroom[0];
+                obj.max += v.max_price * 6 * extrajson.bathroom[0];
+                break;
+              case "卫浴":
+                let num = extrajson.bathroom[2];
+                if (num == ">") num = 4;
+                obj.min += v.min_price * 4 * num;
+                obj.max += v.max_price * 4 * num;
+                break;
+              case "背景墙":
+                let bjq = extrajson.wall[0];
+                if (bjq == ">") bjq = 4;
+                obj.min += v.min_price * 4 * bjq;
+                obj.max += v.max_price * 4 * bjq;
+                break;
+            }
+          });
+          this.price = obj;
+          this.sa_storeid = sa_storeid;
+          console.log(obj);
         });
-        this.isInitializeLogin(render.bind(this))
-        function render(that) {
-            that.calculate(options.sa_storeid || uni.getStorageSync('shop').sa_storeid)
-        }
     },
-    methods: {
-        calculate(sa_storeid) {
-            this.$Http.basic({
-                "id": 20240515131702,
-                "content": {
-                    sa_storeid
-                }
-            }).then(res => {
-                console.log("获取门店装修预算", res)
-                if (this.cutoff(res.msg)) return;
-                let extrajson = this.extrajson
-                let obj = {
-                    min: 0,
-                    max: 0
-                }
-                res.data.forEach(v => {
-                    switch (v.type) {
-                        case "厨房":
-                            obj.min += v.min_price * 6 * extrajson.bathroom[0]
-                            obj.max += v.max_price * 6 * extrajson.bathroom[0]
-                            break;
-                        case "卫浴":
-                            let num = extrajson.bathroom[2];
-                            if (num == '>') num = 4;
-                            obj.min += v.min_price * 4 * num;
-                            obj.max += v.max_price * 4 * num;
-                            break;
-                        case "背景墙":
-                            let bjq = extrajson.wall[0];
-                            if (bjq == '>') bjq = 4;
-                            obj.min += v.min_price * 4 * bjq;
-                            obj.max += v.max_price * 4 * bjq;
-                            break;
-                    }
-                })
-                this.price = obj;
-                this.sa_storeid = sa_storeid;
-                console.log(obj)
-            })
-        },
-        getSheraDate() {
-            return {
-                title: '您的装修报价是:', // 标题
-                path: "/store/budget/result?data=" + JSON.stringify(this.extrajson) + '&sa_storeid=' + this.sa_storeid, // 分享路径
-                imageUrl: ""// 分享图
-            };
-        }
+    getSheraDate() {
+      return {
+        title: "您的装修报价是:", // 标题
+        path:
+          "/store/budget/result?data=" +
+          JSON.stringify(this.extrajson) +
+          "&sa_storeid=" +
+          this.sa_storeid +
+          "&shareUserid=" +
+          this.shareUserid, // 分享路径
+        imageUrl: "", // 分享图
+      };
     },
-    onShareAppMessage(res) {
-        return this.getSheraDate()
-    },
-    onShareTimeline() {
-        return this.getSheraDate()
-    }
-}
+  },
+  onShareAppMessage(res) {
+    return this.getSheraDate();
+  },
+  onShareTimeline() {
+    return this.getSheraDate();
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 .box {
-    width: 100vw;
-    padding: 30px 20px;
-    box-sizing: border-box;
-    background: radial-gradient(100% 0% at 50% 50%, #7E7E7E 0%, #787878 100%);
+  width: 100vw;
+  padding: 30px 20px;
+  box-sizing: border-box;
+  background: radial-gradient(100% 0% at 50% 50%, #7e7e7e 0%, #787878 100%);
 
-    .title {
-        line-height: 22px;
-        font-family: PingFang SC, PingFang SC;
-        font-size: 16px;
-        color: #FFFFFF;
-    }
+  .title {
+    line-height: 22px;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 16px;
+    color: #ffffff;
+  }
 
-    .price-box {
-        display: flex;
-        width: 100%;
-        margin-top: 15px;
-        align-items: center;
+  .price-box {
+    display: flex;
+    width: 100%;
+    margin-top: 15px;
+    align-items: center;
 
-        .price {
-            width: 146px;
-            height: 45px;
-            line-height: 45px;
-            text-align: center;
-            box-sizing: border-box;
-            background: rgba(255, 255, 255, 0.2);
-            border-radius: 2px;
-            border: 1px solid rgba(255, 255, 255, 0.2);
-            font-family: Source Han Sans SC, Source Han Sans SC;
-            font-weight: bold;
-            font-size: 24px;
-            color: #FFFFFF;
-        }
+    .price {
+      width: 146px;
+      height: 45px;
+      line-height: 45px;
+      text-align: center;
+      box-sizing: border-box;
+      background: rgba(255, 255, 255, 0.2);
+      border-radius: 2px;
+      border: 1px solid rgba(255, 255, 255, 0.2);
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-weight: bold;
+      font-size: 24px;
+      color: #ffffff;
+    }
 
-        .link {
-            width: 14px;
-            text-align: center;
-            font-family: Source Han Sans SC, Source Han Sans SC;
-            font-weight: bold;
-            font-size: 24px;
-            color: #FFFFFF;
-            margin: 0 4px;
-            margin-right: 6px;
-        }
+    .link {
+      width: 14px;
+      text-align: center;
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-weight: bold;
+      font-size: 24px;
+      color: #ffffff;
+      margin: 0 4px;
+      margin-right: 6px;
+    }
 
-        .unit {
-            font-family: PingFang SC, PingFang SC;
-            font-size: 14px;
-            color: #FFFFFF;
-            margin-left: 10px;
-        }
+    .unit {
+      font-family: PingFang SC, PingFang SC;
+      font-size: 14px;
+      color: #ffffff;
+      margin-left: 10px;
     }
+  }
 }
 </style>

+ 64 - 46
store/lottery/shareable.vue

@@ -1,57 +1,75 @@
 <template>
-    <view>
-        <sudoku ref="sudoku" :sa_awardid="sa_awardid" :shareuserid="shareuserid" />
-    </view>
+  <view>
+    <sudoku ref="sudoku" :sa_awardid="sa_awardid" :shareuserid="shareuserid" />
+  </view>
 </template>
 
 <script>
-import sudoku from "./modules/sudoku"
+import sudoku from "./modules/sudoku";
+import { winTheCustomer } from "../../utils/share";
 export default {
-    components: { sudoku },
-    data() {
-        return {
-            sa_awardid: 0,
-            shareuserid: 0,
-            detail: {},
-        }
-    },
-    onLoad(options) {
-        console.log("options", options)
-        this.sa_awardid = options.sa_awardid || 0;
-        this.shareuserid = options.userid || 0;
-        uni.setNavigationBarTitle({
-            title: '活动抽奖'
-        });
-    },
-    onShow() {
-        this.$Http.basic({
-            "id": 20240514101502,
-            "content": {
-                "sa_awardid": this.sa_awardid,
-            }
-        }).then(res => {
-            console.log("抽奖详情", res)
-            if (this.cutoff(res.msg)) return;
-            this.detail = res.data;
-            this.$refs.sudoku.init();
+  components: { sudoku },
+  data() {
+    return {
+      sa_awardid: 0,
+      shareuserid: 0,
+      detail: {},
+      initialize: false,
+    };
+  },
+  onLoad(options) {
+    console.log("options", options);
+    this.sa_awardid = options.sa_awardid || 0;
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      this.getDetail();
+      this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖");
+    }
+
+    uni.setNavigationBarTitle({
+      title: "活动抽奖",
+    });
+  },
+  onShow() {
+    if (!this.initialize) this.getDetail();
+  },
+  methods: {
+    getDetail() {
+      this.$Http
+        .basic({
+          id: 20240514101502,
+          content: {
+            sa_awardid: this.sa_awardid,
+          },
         })
-    }, methods: {
-        getSheraDate() {
-            let detail = this.detail;;
-            return {
-                title: detail.name, // 标题
-                path: "/store/lottery/shareable?sa_awardid=" + detail.sa_awardid + '&shareuserid=' + uni.getStorageSync('userMsg').userid, // 分享路径
-                imageUrl: ""// 分享图
-            };
-        }
+        .then((res) => {
+          console.log("抽奖详情", res);
+          if (this.cutoff(res.msg)) return;
+          this.initialize = true;
+          this.detail = res.data;
+          this.$refs.sudoku.init();
+        });
     },
-    onShareAppMessage() {
-        return this.getSheraDate()
+    getSheraDate() {
+      let detail = this.detail;
+      return {
+        title: detail.name, // 标题
+        path:
+          "/store/lottery/shareable?sa_awardid=" +
+          detail.sa_awardid +
+          "&shareUserid=" +
+          this.shareUserid, // 分享路径
+        imageUrl: "", // 分享图
+      };
     },
-    onShareTimeline() {
-        return this.getSheraDate()
-    }
-}
+  },
+  onShareAppMessage() {
+    return this.getSheraDate();
+  },
+  onShareTimeline() {
+    return this.getSheraDate();
+  },
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 238 - 191
team/team/InviteUser.vue

@@ -1,225 +1,272 @@
 <template>
-    <My_listbox ref="List" :pullDown="false" boxBackground="linear-gradient( 225deg, #F7CA9D 0%, #FF5757 100%)">
-        <view class="head" :style="{ height: tovw(CustomBar) }">
-            <view class="custom" :style="{ height: tovw(Custom.height), top: tovw(Custom.top - 3) }">
-                邀请人员
-                <view class="back" :style="{ lineHeight: tovw(Custom.height) }" @click="onBack">
-                    <text class=" iconfont icon-a-wodetiaozhuan" />
-                </view>
-            </view>
+  <My_listbox
+    ref="List"
+    :pullDown="false"
+    boxBackground="linear-gradient( 225deg, #F7CA9D 0%, #FF5757 100%)"
+  >
+    <view class="head" :style="{ height: tovw(CustomBar) }">
+      <view
+        class="custom"
+        :style="{ height: tovw(Custom.height), top: tovw(Custom.top - 3) }"
+      >
+        邀请人员
+        <view
+          class="back"
+          :style="{ lineHeight: tovw(Custom.height) }"
+          @click="onBack"
+        >
+          <text class="iconfont icon-a-wodetiaozhuan" />
         </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;" />
+      </view>
+    </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/202406011717209838416B6150695f.webp'"
-                        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-image
+            :src="
+              userMsg.headpic ||
+              'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'
+            "
+            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="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:96px;line-height:17px;position: absolute;left:50%;bottom:269px;z-index:2;margin-left:-48px;font-size: 12px;color: #666666;font-family: PingFang SC, PingFang SC;" />
-                    <l-painter-qrcode :text="qrCode + 'teamInvite?id=' + userMsg.sys_enterpriseid"
-                        css="width: 200px; height: 200px;position: absolute;left:50%;bottom:55px;z-index:2;margin-left:-100px;" />
-                </l-painter>
-            </view>
+          <l-painter-text
+            text="扫码登记人员信息"
+            css="width:96px;line-height:17px;position: absolute;left:50%;bottom:269px;z-index:2;margin-left:-48px;font-size: 12px;color: #666666;font-family: PingFang SC, PingFang SC;"
+          />
+          <l-painter-qrcode
+            :text="qrCode + 'teamInvite?id=' + userMsg.sys_enterpriseid"
+            css="width: 200px; height: 200px;position: absolute;left:50%;bottom:55px;z-index:2;margin-left:-100px;"
+          />
+        </l-painter>
+      </view>
+    </view>
+    <view class="share">
+      <contact openType="share">
+        <view class="item">
+          <text class="iconfont icon-weixin" />
         </view>
-        <view class="share">
-            <contact openType="share">
-                <view class="item">
-                    <text class="iconfont icon-weixin" />
-                </view>
-            </contact>
+      </contact>
 
-            <view class="item" @click="saveTheImage">
-                <text class="iconfont icon-baocunbendi" />
-            </view>
-        </view>
-    </My_listbox>
+      <view class="item" @click="saveTheImage">
+        <text class="iconfont icon-baocunbendi" />
+      </view>
+    </view>
+  </My_listbox>
 </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"
-
+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";
+import { winTheCustomer } from "../../utils/share";
 export default {
-    components: { lPainter, lPainterView, lPainterText, lPainterImage, lPainterQrcode, contact },
-    data() {
-        return {
-            userMsg: {
-                userid: 0
-            },
-            qrCode: this.qrCodePrefix,
-            name: ""
-        }
-    },
-    onLoad() {
-        this.getUserMsg()
+  components: {
+    lPainter,
+    lPainterView,
+    lPainterText,
+    lPainterImage,
+    lPainterQrcode,
+    contact,
+  },
+  data() {
+    return {
+      userMsg: {
+        userid: 0,
+      },
+      qrCode: this.qrCodePrefix,
+      name: "",
+    };
+  },
+  onLoad() {
+    this.isInitializeLogin(render.bind(this));
+    function render() {
+      this.getUserMsg();
+      // this.shareUserid = winTheCustomer(options.shareUserid || 0, "团队邀请");
+    }
+  },
+  methods: {
+    getUserMsg() {
+      this.$Http
+        .basic({
+          id: 20240510104102,
+          content: {},
+        })
+        .then((res) => {
+          console.log("获取个人信息", res);
+          if (this.cutoff(res.msg)) return;
+          res.data.headpic =
+            (res.data.attinfos.find((v) => v.usetype == "headportrait") &&
+              res.data.attinfos.find((v) => v.usetype == "headportrait").url) ||
+            "";
+          this.userMsg = res.data;
+          this.name = res.data.enterprise_hr.name
+            ? res.data.enterprise_hr.name + ",邀请您加入"
+            : "邀请您加入";
+        });
     },
-    methods: {
-        getUserMsg() {
-            this.$Http.basic({
-                "id": 20240510104102,
-                "content": {},
-            }).then(res => {
-                console.log("获取个人信息", res)
-                if (this.cutoff(res.msg)) return;
-                res.data.headpic = res.data.attinfos.find(v => v.usetype == "headportrait") && res.data.attinfos.find(v => v.usetype == "headportrait").url || '';
-                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;
-                            that.$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,
-                                })
-                            }
-                        },
+    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;
+              that.$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,
+                          });
+                        }
+                      },
                     });
-                },
-            });
-        },
-        onBack() {
-            uni.navigateBack();
+                  },
+                });
+              } else {
+                that.loading = false;
+                uni.showModal({
+                  title: "提示",
+                  content: "已取消保存",
+                  showCancel: false,
+                });
+              }
+            },
+          });
         },
-        getSheraDate() {
-            return {
-                title: this.name, // 标题
-                path: "/team/team/getInvite?id=" + this.userMsg.sys_enterpriseid, // 分享路径
-                imageUrl: ""// 分享图
-            };
-        }
+      });
     },
-    onShareAppMessage(res) {
-        return this.getSheraDate()
+    onBack() {
+      uni.navigateBack();
     },
-    onShareTimeline() {
-        return this.getSheraDate()
-    }
-}
+    getSheraDate() {
+      return {
+        title: this.name, // 标题
+        path: "/team/team/getInvite?id=" + this.userMsg.sys_enterpriseid, // 分享路径
+        imageUrl: "", // 分享图
+      };
+    },
+  },
+  onShareAppMessage(res) {
+    return this.getSheraDate();
+  },
+  onShareTimeline() {
+    return this.getSheraDate();
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 .head {
-    position: relative;
-    width: 100vw;
+  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;
+  .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);
-        }
+    .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;
+  display: flex;
+  justify-content: center;
+  margin-top: 25px;
 }
 
 .share {
-    display: flex;
-    justify-content: space-around;
-    width: 275px;
-    margin: 30px auto 0;
+  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;
+  .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;
-        }
+    .iconfont {
+      font-size: 28px;
+      color: #fff;
     }
+  }
 }
 </style>

+ 172 - 0
utils/share.js

@@ -0,0 +1,172 @@
+import Vue from 'vue'
+//判断进入的场景值 
+function sceneInfo(scene) {
+    const sceneList = {
+        '1000': '其他',
+        '1001': '发现页小程序「最近使用」列表',
+        '1005': '微信首页顶部搜索框的搜索结果页',
+        '1006': '发现栏小程序主入口搜索框的搜索结果页',
+        '1007': '单人聊天会话中的小程序消息卡片',
+        '1008': '群聊会话中的小程序消息卡片',
+        '1010': '收藏夹',
+        '1011': '扫描二维码',
+        '1012': '长按图片识别二维码',
+        '1013': '扫描手机相册中选取的二维码',
+        '1014': '小程序订阅消息(与1107相同)',
+        '1017': '前往小程序体验版的入口页',
+        '1019': '微信钱包(微信客户端7.0.0版本改为支付入口)',
+        '1020': '公众号 profile 页相关小程序列表(已废弃)',
+        '1022': '聊天顶部置顶小程序入口',
+        '1023': '安卓系统桌面图标',
+        '1024': '小程序 profile 页	',
+        '1025': '扫描一维码',
+        '1026': '发现栏小程序主入口,「附近的小程序」列表',
+        '1027': '微信首页顶部搜索框搜索结果页「使用过的小程序」列表',
+        '1028': '我的卡包',
+        '1029': '小程序中的卡券详情页',
+        '1030': '自动化测试下打开小程序',
+        '1031': '长按图片识别一维码',
+        '1032': '扫描手机相册中选取的一维码',
+        '1034': '微信支付完成页',
+        '1035': '公众号自定义菜单',
+        '1036': 'App 分享消息卡片',
+        '1037': '小程序打开小程序',
+        '1038': '从另一个小程序返回',
+        '1039': '摇电视',
+        '1042': '添加好友搜索框的搜索结果页',
+        '1043': '公众号模板消息',
+        '1044': '带 shareTicket 的小程序消息卡片',
+        '1045': '朋友圈广告',
+        '1046': '朋友圈广告详情页',
+        '1047': '扫描小程序码',
+        '1048': '长按图片识别小程序码',
+        '1049': '扫描手机相册中选取的小程序码',
+        '1052': '卡券的适用门店列表',
+        '1053': '搜一搜的结果页',
+        '1054': '顶部搜索框小程序快捷入口',
+        '1056': '聊天顶部音乐播放器右上角菜单',
+        '1057': '钱包中的银行卡详情页',
+        '1058': '公众号文章',
+        '1059': '体验版小程序绑定邀请页',
+        '1060': '微信支付完成页(与1034相同)',
+        '1064': '微信首页连Wi-Fi状态栏',
+        '1065': 'URL scheme',
+        '1067': '公众号文章广告',
+        '1068': '附近小程序列表广告(已废弃)',
+        '1069': '移动应用通过openSDK进入微信,打开小程序',
+        '1071': '钱包中的银行卡列表页',
+        '1072': '二维码收款页面',
+        '1073': '客服消息列表下发的小程序消息卡片',
+        '1074': '公众号会话下发的小程序消息卡片',
+        '1077': '摇周边',
+        '1078': '微信连Wi-Fi成功提示页',
+        '1079': '微信游戏中心',
+        '1081': '客服消息下发的文字链',
+        '1082': '公众号会话下发的文字链',
+        '1084': '朋友圈广告原生页',
+        '1088': '会话中,系统消息,打开小程序',
+        '1089': '微信聊天主界面下拉,「最近使用」栏',
+        '1090': '长按小程序右上角菜单唤出最近使用历史',
+        '1091': '公众号文章商品卡片',
+        '1092': '城市服务入口',
+        '1095': '小程序广告组件',
+        '1096': '聊天记录,打开小程序',
+        '1097': '微信支付签约原生页,打开小程序',
+        '1099': '页面内嵌插件',
+        '1100': '红包封面详情页打开小程序',
+        '1101': '远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)',
+        '1102': '公众号 profile 页服务预览',
+        '1103': '发现页小程序「我的小程序」列表',
+        '1104': '微信聊天主界面下拉,「我的小程序」栏',
+        '1106': '聊天主界面下拉,从顶部搜索结果页,打开小程序',
+        '1107': '订阅消息,打开小程序',
+        '1113': '安卓手机负一屏,打开小程序(三星)',
+        '1114': '安卓手机侧边栏,打开小程序(三星)',
+        '1119': '【企业微信】工作台内打开小程序',
+        '1120': '【企业微信】个人资料页内打开小程序',
+        '1121': '【企业微信】聊天加号附件框内打开小程序',
+        '1124': '扫“一物一码”打开小程序',
+        '1125': '长按图片识别“一物一码”',
+        '1126': '扫描手机相册中选取的“一物一码”',
+        '1129': '微信爬虫访问',
+        '1131': '浮窗',
+        '1133': '硬件设备打开小程序',
+        '1135': '小程序profile页相关小程序列表,打开小程序',
+        '1144': '公众号文章 - 视频贴片',
+        '1145': '发现栏 - 发现小程序',
+        '1146': '地理位置信息打开出行类小程序',
+        '1148': '卡包-交通卡,打开小程序',
+        '1150': '扫一扫商品条码结果页打开小程序',
+        '1151': '发现栏 - 我的订单',
+        '1152': '订阅号视频打开小程序',
+        '1153': '“识物”结果页打开小程序',
+        '1154': '朋友圈内打开“单页模式”',
+        '1155': '“单页模式”打开小程序',
+        '1157': '服务号会话页打开小程序',
+        '1158': '群工具打开小程序',
+        '1160': '群待办',
+        '1167': 'H5 通过开放标签打开小程序',
+        '1168': '移动/网站应用直接运行小程序',
+        '1169': '发现栏小程序主入口,各个生活服务入口(例如快递服务、出行服务等)',
+        '1171': '微信运动记录(仅安卓)',
+        '1173': '聊天素材用小程序打开 详情',
+        '1175': '视频号主页商店入口',
+        '1176': '视频号直播间主播打开小程序',
+        '1177': '视频号直播商品',
+        '1178': '在电脑打开手机上打开的小程序',
+        '1179': '#话题页打开小程序',
+        '1181': '网站应用打开PC小程序',
+        '1183': 'PC微信 - 小程序面板 - 发现小程序 - 搜索',
+        '1184': '视频号链接打开小程序',
+        '1185': '群公告',
+        '1186': '收藏 - 笔记',
+        '1187': '浮窗',
+        '1189': '表情雨广告',
+        '1191': '视频号活动',
+        '1192': '企业微信联系人profile页',
+        '1193': '视频号主页服务菜单打开小程序',
+        '1194': 'URL Link 详情',
+        '1195': '视频号主页商品tab',
+        '1196': '个人状态打开小程序',
+        '1197': '视频号主播从直播间返回小游戏',
+        '1198': '视频号开播界面打开小游戏',
+        '1200': '视频号广告打开小程序',
+        '1201': '视频号广告详情页打开小程序',
+        '1202': '企微客服号会话打开小程序卡片',
+        '1203': '微信小程序压测工具的请求',
+        '1206': '视频号小游戏直播间打开小游戏',
+        '1207': '企微客服号会话打开小程序文字链',
+        '1208': '聊天打开商品卡片',
+        '1212': '青少年模式申请页打开小程序',
+        '1215': '广告预约打开小程序',
+        '1216': '视频号订单中心打开小程序',
+        '1223': '安卓桌面Widget打开小程序',
+        '1228': '视频号原生广告组件打开小程序',
+        '1230': '订阅号H5广告进入小程序',
+        '1231': '动态消息提醒入口打开小程序',
+        '1242': '小程序发现页门店快送模块频道页进入小程序',
+        '1245': '小程序发现页门店快送搜索结果页进入小程序',
+        '1252': '搜一搜小程序搜索页「小功能」模块进入小程序'
+    }
+    let channel = sceneList[scene ? scene + '' : uni.getLaunchOptionsSync().scene + ''] || '未知';
+    console.log("channel", channel)
+    return channel;
+}
+
+function winTheCustomer(shareUserid = 0, appname, scene = '') {
+    if (!shareUserid) return uni.getStorageSync('userMsg').userid;
+    Vue.prototype.$Http.basic({
+        "id": "2024061113525202",
+        "content": {
+            shareuserid: shareUserid,
+            "channel": sceneInfo(scene), //渠道
+            appname //应用名称
+        }
+    }).then(res => {
+        console.log("记录获客", res)
+    })
+    return uni.getStorageSync('userMsg').shareUserid;
+}
+module.exports = {
+    winTheCustomer
+}