shish před 10 měsíci
rodič
revize
57709d1d9d

+ 181 - 0
hdApp/src/admin/cg/album.vue

@@ -0,0 +1,181 @@
+<template>
+  <view class="app-content">
+
+    <view class="img_box" style="margin-top:30upx;">
+      <image :src="albumUrl" mode="heightFix" class="img_url"></image>
+    </view>
+    <view style="margin:20upx auto 20upx auto;width:50vw;font-size:35upx;font-weight:bold;text-align:center;">相册</view>
+    <div class="confirm-btn">
+      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(albumUrl)">保存图片</button>
+    </div>
+    <div class="confirm-btn1">
+      <button class="admin-button-com big" style="width:60vw;" @click="goToMallPt('pages/home/mall')">直接打开</button>
+    </div>
+
+    <view class="confirm-btn1" style="margin-top:100upx;">
+      <button class="admin-button-com big" style="width:60vw;" @click="copyLink">复制链接</button>
+    </view>
+
+  </view>
+</template>
+<script>
+import { mainGetAlbumPoster } from '@/api/main'
+import { getWeixinId } from "@/api/invite";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    return {
+      albumUrl:'',
+      albumLink:'',
+      getappIdList: {}
+    }
+  },
+  computed: {
+    ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
+  },
+  methods: {
+    copyLink() {
+      let text = "点击下面链接,打开相册\n\n"+this.albumLink+"\n\n链接是我们小程序,放心点击"
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          this.$msg('已复制')
+        },
+        fail: () => {
+          this.$msg('复制失败')
+        }
+      })
+    },
+    init() {
+      this.getImg()
+      getWeixinId().then(res => {
+        this.getappIdList = res.data
+      });
+    },
+    downloadImg(url){
+				// #ifdef APP-PLUS
+				let platformType = uni.getSystemInfoSync().platform
+				if(platformType == 'android'){
+					let store = plus.navigator.checkPermission('android.permission.READ_EXTERNAL_STORAGE')
+					if(store != 'authorized'){
+						this.$util.confirmModal({content:'将申请您的存储权限,用于保存小程序码'},() => {
+							this.downloadImg2(url)
+      			})
+					}else{
+						this.downloadImg2(url)
+					}
+				}else{
+					this.downloadImg2(url)
+				}
+				// #endif
+				// #ifdef MP-WEIXIN
+				this.downloadImg2(url)
+				// #endif
+		},
+    downloadImg2(url){
+      uni.downloadFile({
+        url: url,
+        success: (res) => {
+          if (res.statusCode === 200) {
+            uni.saveImageToPhotosAlbum({
+              filePath: res.tempFilePath,
+              success: function (data) {
+                uni.showToast({title:'下载成功!'})
+              }
+            });
+          }
+        }
+      });
+    },
+    getImg() {
+      mainGetAlbumPoster().then(res => {
+        this.albumUrl = res.data.albumUrl
+        this.albumLink = res.data.albumLink
+      }).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>
+
+<style lang="scss" scoped>
+.app-content{
+  overflow: hidden;
+}
+.img_box{
+  height:400upx;
+  box-sizing: border-box;
+  &>.img_url{
+    height:400upx;
+    width: auto;
+    margin: 20upx auto;
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 30upx 30upx 20upx;
+  text-align:center;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+// 按钮
+.confirm-btn1 {
+  width: calc(100% - 60upx);
+  margin: 30upx 30upx 20upx;
+  text-align:center;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 180 - 0
hdApp/src/admin/cg/item.vue

@@ -0,0 +1,180 @@
+<template>
+  <view class="app-content">
+
+    <view class="img_box" style="margin-top:30upx;">
+      <image :src="flowerUrl" mode="heightFix" class="img_url"></image>
+    </view>
+    <view style="margin:20upx auto 20upx auto;width:50vw;font-size:35upx;font-weight:bold;text-align:center;">花材绿植</view>
+    <div class="confirm-btn">
+      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(flowerUrl)">保存图片</button>
+    </div>
+    <div class="confirm-btn1">
+      <button class="admin-button-com big" style="width:60vw;" @click="goToMallPt('pages/item/item')">直接打开</button>
+    </div>
+
+    <view class="confirm-btn1" style="margin-top:100upx;">
+      <button class="admin-button-com big" style="width:60vw;" @click="copyLink">复制链接</button>
+    </view>
+
+  </view>
+</template>
+<script>
+import { mainGetItemPoster } from '@/api/main'
+import { getWeixinId } from "@/api/invite";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    return {
+      flowerUrl:'',
+      flowerLink:'',
+      getappIdList: {}
+    }
+  },
+  computed: {
+    ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
+  },
+  methods: {
+    copyLink() {
+      let text = "点击下面链接,打开商城\n\n"+this.flowerLink+"\n\n链接是我们小程序,放心点击"
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          this.$msg('已复制')
+        },
+        fail: () => {
+          this.$msg('复制失败')
+        }
+      })
+    },
+    init() {
+      this.getImg()
+      getWeixinId().then(res => {
+        this.getappIdList = res.data
+      });
+    },
+    downloadImg(url){
+				// #ifdef APP-PLUS
+				let platformType = uni.getSystemInfoSync().platform
+				if(platformType == 'android'){
+					let store = plus.navigator.checkPermission('android.permission.READ_EXTERNAL_STORAGE')
+					if(store != 'authorized'){
+						this.$util.confirmModal({content:'将申请您的存储权限,用于保存小程序码'},() => {
+							this.downloadImg2(url)
+      			})
+					}else{
+						this.downloadImg2(url)
+					}
+				}else{
+					this.downloadImg2(url)
+				}
+				// #endif
+				// #ifdef MP-WEIXIN
+				this.downloadImg2(url)
+				// #endif
+		},
+    downloadImg2(url){
+      uni.downloadFile({
+        url: url,
+        success: (res) => {
+          if (res.statusCode === 200) {
+            uni.saveImageToPhotosAlbum({
+              filePath: res.tempFilePath,
+              success: function (data) {
+                uni.showToast({title:'下载成功!'})
+              }
+            });
+          }
+        }
+      });
+    },
+    getImg() {
+      mainGetItemPoster().then(res => {
+        this.flowerUrl = res.data.flowerUrl
+      }).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>
+
+<style lang="scss" scoped>
+.app-content{
+  overflow: hidden;
+}
+.img_box{
+  height:400upx;
+  box-sizing: border-box;
+  &>.img_url{
+    height:400upx;
+    width: auto;
+    margin: 20upx auto;
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 30upx 30upx 20upx;
+  text-align:center;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+// 按钮
+.confirm-btn1 {
+  width: calc(100% - 60upx);
+  margin: 30upx 30upx 20upx;
+  text-align:center;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 29 - 23
hdApp/src/admin/cg/mall.vue

@@ -2,28 +2,22 @@
   <view class="app-content">
   <view class="app-content">
 
 
     <view class="img_box" style="margin-top:30upx;">
     <view class="img_box" style="margin-top:30upx;">
-      <image :src="flowerImgUrl" mode="heightFix" class="img_url"></image>
+      <image :src="goodsUrl" mode="heightFix" class="img_url"></image>
     </view>
     </view>
-    <view style="margin:20upx auto 20upx auto;width:50vw;font-size:35upx;font-weight:bold;text-align:center;">鲜花</view>
-    <div class="confirm-btn">
-      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(flowerImgUrl)">保存图片</button>
-    </div>
-    <div class="confirm-btn1">
-      <button class="admin-button-com big blue" style="width:60vw;" @click="goToMallPt('pages/item/item')">直接打开</button>
-    </div>
 
 
+    <view style="margin:20upx auto 20upx auto;width:50vw;font-size:35upx;font-weight:bold;text-align:center;">花束商城</view>
 
 
-    <view class="img_box" style="margin-top:30upx;">
-      <image :src="imgUrl" mode="heightFix" class="img_url"></image>
+    <view class="confirm-btn">
+      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(goodsUrl)">保存图片</button>
+    </view>
+
+    <view class="confirm-btn1">
+      <button class="admin-button-com big" style="width:60vw;" @click="goToMallPt('pages/home/category')">直接打开</button>
     </view>
     </view>
-    <view style="margin:20upx auto 20upx auto;width:50vw;font-size:35upx;font-weight:bold;text-align:center;">花束</view>
-    <div class="confirm-btn">
-      <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(imgUrl)">保存图片</button>
-    </div>
-    <div class="confirm-btn1">
-      <button class="admin-button-com big blue" style="width:60vw;" @click="goToMallPt('pages/home/category')">直接打开</button>
-    </div>
 
 
+    <view class="confirm-btn1" style="margin-top:100upx;">
+      <button class="admin-button-com big" style="width:60vw;" @click="copyLink">复制链接</button>
+    </view>
 
 
   </view>
   </view>
 </template>
 </template>
@@ -34,8 +28,8 @@ import { mapGetters } from "vuex";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
-      imgUrl: '',
-      flowerImgUrl:'',
+      goodsUrl: '',
+      goodsLink:'',
       getappIdList: {}
       getappIdList: {}
     }
     }
   },
   },
@@ -43,6 +37,18 @@ export default {
     ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
     ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
   },
   },
   methods: {
   methods: {
+    copyLink() {
+      let text = "点击下面链接,打开商城\n\n"+this.goodsLink+"\n\n链接是我们小程序,放心点击"
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          this.$msg('已复制')
+        },
+        fail: () => {
+          this.$msg('复制失败')
+        }
+      })
+    },
     init() {
     init() {
       this.getImg()
       this.getImg()
       getWeixinId().then(res => {
       getWeixinId().then(res => {
@@ -86,8 +92,8 @@ export default {
     },
     },
     getImg() {
     getImg() {
       mainGetMallPoster().then(res => {
       mainGetMallPoster().then(res => {
-        this.imgUrl = res.data.imgUrl
-        this.flowerImgUrl = res.data.flowerImgUrl
+        this.goodsUrl = res.data.goodsUrl
+        this.goodsLink = res.data.goodsLink
       }).catch(err => {})
       }).catch(err => {})
     },
     },
     goToMallPt (url) {
     goToMallPt (url) {
@@ -149,10 +155,10 @@ export default {
   overflow: hidden;
   overflow: hidden;
 }
 }
 .img_box{
 .img_box{
-  height:300upx;
+  height:400upx;
   box-sizing: border-box;
   box-sizing: border-box;
   &>.img_url{
   &>.img_url{
-    height:300upx;
+    height:400upx;
     width: auto;
     width: auto;
     margin: 20upx auto;
     margin: 20upx auto;
   }
   }

+ 5 - 5
hdApp/src/admin/home/workbench.vue

@@ -77,7 +77,7 @@
           </view>
           </view>
         </view>
         </view>
       </template>
       </template>
-      
+
       <view class="module-com news-wrap">
       <view class="module-com news-wrap">
         <view class="news-list" v-for="(item, index) in data.notice" :key="index" @click="noticeFn(item)" >
         <view class="news-list" v-for="(item, index) in data.notice" :key="index" @click="noticeFn(item)" >
           <view class="news-left">
           <view class="news-left">
@@ -110,13 +110,13 @@
             <view class="header-line"></view>
             <view class="header-line"></view>
           </view>
           </view>
           <view class="icon-grid">
           <view class="icon-grid">
-            <view class="icon-item" @click="showMallOptions(1)">
+            <view class="icon-item" @click="goPage({url: '/admin/cg/mall'})">
               <view class="icon-wrapper">
               <view class="icon-wrapper">
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
               </view>
               </view>
               <view class="icon-text">商城</view>
               <view class="icon-text">商城</view>
             </view>
             </view>
-            <view class="icon-item" @click="showMallOptions(2)">
+            <view class="icon-item" @click="goPage({url: '/admin/cg/album'})">
               <view class="icon-wrapper">
               <view class="icon-wrapper">
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
               </view>
               </view>
@@ -160,7 +160,7 @@
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
-        
+
         <!-- 绿植花材 -->
         <!-- 绿植花材 -->
         <view class="flower-section">
         <view class="flower-section">
           <view class="section-header">
           <view class="section-header">
@@ -169,7 +169,7 @@
             <view class="header-line"></view>
             <view class="header-line"></view>
           </view>
           </view>
           <view class="icon-grid">
           <view class="icon-grid">
-            <view class="icon-item" @click="showMallOptions(3)">
+            <view class="icon-item" @click="goPage({url: '/admin/cg/item'})">
               <view class="icon-wrapper">
               <view class="icon-wrapper">
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
                 <image class="icon-image" :src="`${constant.hostUrl}/image/ghs/home/shop2.png`" mode="aspectFit"></image>
               </view>
               </view>

+ 8 - 0
hdApp/src/api/main/index.js

@@ -7,6 +7,14 @@ export const mainGetMallPoster = data => {
 	return https.get('/main/get-mall-poster', data)
 	return https.get('/main/get-mall-poster', data)
 }
 }
 
 
+export const mainGetAlbumPoster = data => {
+	return https.get('/main/get-album-poster', data)
+}
+
+export const mainGetItemPoster = data => {
+	return https.get('/main/get-item-poster', data)
+}
+
 export const mainGetMemberPoster = data => {
 export const mainGetMemberPoster = data => {
 	return https.get('/main/get-member-poster', data)
 	return https.get('/main/get-member-poster', data)
 }
 }

+ 2 - 0
hdApp/src/pages.json

@@ -114,6 +114,8 @@
 			"root": "admin/cg",
 			"root": "admin/cg",
 			"pages": [
 			"pages": [
 				{ "path": "mall", "style": { "navigationBarTitleText": "商城" } },
 				{ "path": "mall", "style": { "navigationBarTitleText": "商城" } },
+				{ "path": "album", "style": { "navigationBarTitleText": "相册" } },
+				{ "path": "item", "style": { "navigationBarTitleText": "花材绿植" } },
 				{ "path": "code", "style": { "navigationBarTitleText": "收款码" } },
 				{ "path": "code", "style": { "navigationBarTitleText": "收款码" } },
 				{ "path": "member", "style": { "navigationBarTitleText": "注册会员码" } },
 				{ "path": "member", "style": { "navigationBarTitleText": "注册会员码" } },
 				{ "path": "alipay", "style": { "navigationBarTitleText": "付款" } }
 				{ "path": "alipay", "style": { "navigationBarTitleText": "付款" } }