shish před 13 hodinami
rodič
revize
5e043de4a8
1 změnil soubory, kde provedl 37 přidání a 68 odebrání
  1. 37 68
      hdApp/src/admin/cg/item.vue

+ 37 - 68
hdApp/src/admin/cg/item.vue

@@ -1,3 +1,7 @@
+<!--
+  花店采购页:花材选购小程序码。
+  给花店员工保存或长按识别进入商城花材页;不再直接跳转,统一走小程序码打开。
+-->
 <template>
   <view class="app-content">
     <view class="page-top-bar">
@@ -7,13 +11,17 @@
     </view>
 
     <view class="img_box" style="margin-top:30upx;">
-      <image :src="flowerUrl" mode="heightFix" class="img_url"></image>
+      <!-- 开启长按菜单,微信内可识别小程序码 -->
+      <image :src="flowerUrl" mode="heightFix" class="img_url" show-menu-by-longpress></image>
     </view>
-    <view class="confirm-btn" style="margin-top:60upx;">
-      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(flowerUrl)">保存图片</button>
+    <!-- 仅小程序可长按识别太阳码;App 端没有该能力,不展示提示 -->
+    <!-- #ifdef MP-WEIXIN -->
+    <view class="open-tip-wrap">
+      <text class="open-tip-title">长按小程序码可以直接打开</text>
     </view>
-    <view class="confirm-btn1" style="margin-top:60upx;">
-      <button class="admin-button-com big" style="width:60vw;" @click="goToMallPt('pages/item/item')">直接打开</button>
+    <!-- #endif -->
+    <view class="confirm-btn" style="margin-top:30upx;">
+      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(flowerUrl)">保存图片</button>
     </view>
 
     <!-- <view class="confirm-btn1" style="margin-top:60upx;">
@@ -26,8 +34,6 @@
 </template>
 <script>
 import { mainGetItemPoster } from '@/api/main'
-import { getWeixinId } from "@/api/invite";
-import { mapGetters } from "vuex";
 import { iconSrc } from '@/utils/iconSrc'
 import ShopOpenTimePopup from '@/components/shop-open-time-popup.vue'
 export default {
@@ -37,13 +43,9 @@ export default {
   data() {
     return {
       flowerUrl:'',
-      flowerLink:'',
-      getappIdList: {}
+      flowerLink:''
     }
   },
-  computed: {
-    ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
-  },
   methods: {
     iconSrc,
     copyLink() {
@@ -60,9 +62,6 @@ export default {
     },
     init() {
       this.getImg()
-      getWeixinId().then(res => {
-        this.getappIdList = res.data
-      });
     },
     downloadImg(url){
 				// #ifdef APP-PLUS
@@ -106,56 +105,6 @@ export default {
         this.flowerLink = res.data.flowerLink
       }).catch(err => {})
     },
-    goToMallPt (url) {
-      // #ifdef MP-WEIXIN
-      let self = this
-      uni.navigateToMiniProgram({
-        appId: this.getappIdList.mall.miniAppId,
-        path: url + '?account=' + self.loginInfo.shopId,
-        //develop 开发版 trial 体验版 release 正式版
-        envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-        extraData: {
-          'hdShopAdminId': self.loginInfo.shopAdminId
-        },
-        success (res) {}
-      })
-      // #endif
-      // #ifdef APP-PLUS
-      let that = this
-
-      if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
-        plus.share.getServices(function(s){
-          var sweixin
-          for (var i = 0; i < s.length; i++) {
-            var t = s[i];
-            if (t.id == 'weixin') {
-                sweixin = t;
-            }
-          }
-          if (sweixin && sweixin.nativeClient) {
-            let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.mall ? that.dictInfo.miniOriginalId.current.mall : ''
-            console.log(miniOriginalId)
-            sweixin.launchMiniProgram({
-              id: miniOriginalId,
-              path: '/'+url+'?account='+that.loginInfo.shopId,
-              type: 0
-            });
-          } else {
-            that.$msg("没有找到微信服务")
-            //that.$msg("获取微信失败:" + e.message)
-            console.log(JSON.stringify(e));
-          }
-        }, function(e){
-            that.$msg("没有找到微信服务哦")
-            //that.$msg("获取微信失败:" + e.message)
-            console.log(JSON.stringify(e));
-        });
-      } else {
-				this.$msg("即将跳转小程序,请安装微信")
-				return false
-      }
-			// #endif
-    },
   }
 }
 </script>
@@ -181,10 +130,10 @@ export default {
   height: 54upx;
 }
 .img_box{
-  height:400upx;
+  /* 高度跟小程序码图走,避免图高出盒子后盖住下方「长按打开」文案 */
   box-sizing: border-box;
   &>.img_url{
-    height:400upx;
+    height:500upx;
     width: auto;
     margin: 20upx auto;
   }
@@ -198,6 +147,26 @@ export default {
     width: 100%;
   }
 }
+.open-tip-wrap {
+  margin-top: 24upx;
+  padding: 0 40upx 20upx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.open-tip-title {
+  font-size: 32upx;
+  font-weight: 700;
+  color: #333333;
+  line-height: 1.4;
+}
+.open-tip-desc {
+  margin-top: 16upx;
+  font-size: 26upx;
+  color: #999999;
+  line-height: 1.5;
+  text-align: center;
+}
 // 按钮
 .confirm-btn1 {
   width: calc(100% - 60upx);
@@ -207,4 +176,4 @@ export default {
     width: 100%;
   }
 }
-</style>
+</style>