wangning 5 лет назад
Родитель
Сommit
4c4843831c

+ 111 - 0
ghsApp/src/admin/home/mall.vue

@@ -0,0 +1,111 @@
+<template>
+  <view class="app-content">
+    <view class="img_box">
+      <image :src="imgUrl" class="img_url"></image>
+    </view>
+    <!-- 确认 -->
+      <div class="confirm-btn">
+        <button class="admin-button-com big blue" @click="downloadImg">保存图片分享</button>
+      </div>
+      <div class="confirm-btn1">
+        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">直接打开分享</button>
+      </div>
+  </view>
+</template>
+
+<script>
+import { mainGetMallPoster } from '@/api/main/index'
+import { getWeixinId } from "@/api/invite/index";
+export default {
+  data() {
+    return {
+      imgUrl: '',
+      getappIdList: {}
+    }
+  },
+  methods: {
+    init() {
+      this.getImg()
+      getWeixinId().then(res => {
+        this.getappIdList = res.data
+      });
+    },
+    downloadImg() {
+      uni.downloadFile({
+        url: this.imgUrl,
+        success: (res) => {
+          console.log(res)
+          uni.saveImageToPhotosAlbum({
+            filePath: res.tempFilePath,
+            success: function() {
+              uni.showToast({
+                title: '保存成功',
+                icon: 'none'
+              });
+            },
+            fail: (res) => {
+              // this.$msg('保存失败')
+              uni.showToast({
+                title: '保存失败',
+                icon: 'none'
+              });
+            }
+          })
+        },
+      })
+    },
+    getImg() {
+      mainGetMallPoster().then(res => {
+        console.log(res)
+        this.imgUrl = res.data.imgUrl
+      }).catch(err => {})
+    },
+    goToMallPt (url) {
+      let self = this
+      console.log(url + '?account=' + self.loginInfo.shopId)
+        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) {
+          }
+        })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-content{
+  overflow: hidden;
+}
+.img_box{
+  height: 450upx;
+  box-sizing: border-box;
+  &>.img_url{
+    height: 450upx;
+    width: 450upx;
+    margin: 100upx auto;
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60px);
+  margin: 100px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+// 按钮
+.confirm-btn1 {
+  width: calc(100% - 60px);
+  margin: 50px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

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

@@ -188,7 +188,7 @@ export default {
 				{
 					name: "商城",
 					img: `${this.$constant.imgUrl}/ghs/home/shop.png`,
-					url: "/admin/my-mall"
+					url: "/admin/home/mall"
 				},
 				{
 					name: "改价",
@@ -343,10 +343,10 @@ export default {
 		},
 
 		goPage (item) {
-			if (item.url === '/admin/my-mall') {
-				this.getMyMall()
-				return
-			}
+			// if (item.url === '/admin/my-mall') {
+			// 	this.getMyMall()
+			// 	return
+			// }
 			this.$util.pageTo(item)
 		},
 		// 跳转

+ 9 - 0
ghsApp/src/api/main/index.js

@@ -0,0 +1,9 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+/** *
+ * 商城分享(零售、供货商相同) b  wangning  2021-6-12
+ */
+export const mainGetMallPoster = data => {
+	return https.get('/main/get-mall-poster', data)
+}
+

+ 6 - 0
ghsApp/src/pages.json

@@ -56,6 +56,12 @@
 				"navigationStyle": "custom"
 			}
 		},
+    {
+			"path": "admin/home/mall",
+			"style": {
+				"navigationBarTitleText": "商城"
+			}
+		},
 		{
 			"path": "common/redirect",
 			"style": {

+ 112 - 0
hdApp/src/admin/home/mall.vue

@@ -0,0 +1,112 @@
+<template>
+  <view class="app-content">
+    <view class="img_box">
+      <image :src="imgUrl" class="img_url"></image>
+    </view>
+    <!-- 确认 -->
+      <div class="confirm-btn">
+        <button class="admin-button-com big blue" @click="downloadImg">保存图片分享</button>
+      </div>
+      <div class="confirm-btn1">
+        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">直接打开分享</button>
+      </div>
+  </view>
+</template>
+
+<script>
+import { mainGetMallPoster } from '@/api/main/index'
+import { getWeixinId } from "@/api/invite/index";
+export default {
+  data() {
+    return {
+      imgUrl: '',
+      getappIdList: {}
+    }
+  },
+  methods: {
+    init() {
+      this.getImg()
+      getWeixinId().then(res => {
+        this.getappIdList = res.data
+      });
+    },
+    downloadImg() {
+      uni.downloadFile({
+        url: this.imgUrl,
+        success: (res) => {
+          console.log(res)
+          uni.saveImageToPhotosAlbum({
+            filePath: res.tempFilePath,
+            success: function() {
+              // this.$msg('保存成功')
+              uni.showToast({
+                title: '保存成功',
+                icon: 'none'
+              });
+            },
+            fail: (res) => {
+              // this.$msg('保存失败')
+              uni.showToast({
+                title: '保存失败',
+                icon: 'none'
+              });
+            }
+          })
+        },
+      })
+    },
+    getImg() {
+      mainGetMallPoster().then(res => {
+        console.log(res)
+        this.imgUrl = res.data.imgUrl
+      }).catch(err => {})
+    },
+    goToMallPt (url) {
+      let self = this
+      console.log(url + '?account=' + self.loginInfo.shopId)
+        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) {
+          }
+        })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-content{
+  overflow: hidden;
+}
+.img_box{
+  height: 450upx;
+  box-sizing: border-box;
+  &>.img_url{
+    height: 450upx;
+    width: 450upx;
+    margin: 100upx auto;
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60px);
+  margin: 100px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+// 按钮
+.confirm-btn1 {
+  width: calc(100% - 60px);
+  margin: 50px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

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

@@ -204,7 +204,7 @@ export default {
         {
           name: "商城",
           img: `${this.$constant.imgUrl}/ghs/home/shop.png`,
-          url: "/admin/my-mall"
+          url: "/admin/home/mall"
         },
         {
           name: "收款",
@@ -303,10 +303,10 @@ export default {
         this.goToMallPt('pages/pay/index')
         return true
       }
-      if(item.url === '/admin/my-mall'){
-        this.goToMallPt('pages/home/index')
-        return true
-      }
+      // if(item.url === '/admin/my-mall'){
+      //   this.goToMallPt('pages/home/index')
+      //   return true
+      // 
       this.$util.pageTo(item)
     },
     init () {

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

@@ -0,0 +1,9 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+/** *
+ * 商城分享(零售、供货商相同) b  wangning  2021-6-12
+ */
+export const mainGetMallPoster = data => {
+	return https.get('/main/get-mall-poster', data)
+}
+

+ 6 - 0
hdApp/src/pages.json

@@ -63,6 +63,12 @@
 				"navigationStyle": "custom"
 			}
 		},
+    {
+			"path": "admin/home/mall",
+			"style": {
+				"navigationBarTitleText": "商城"
+			}
+		},
 		{
 			"path": "admin/share/index",
 			"style": {