فهرست منبع

增加邀请开店的页面

wangning 5 سال پیش
والد
کامیت
041c18a0fb

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

@@ -0,0 +1,9 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+/**
+ * 邀请花店(零售、供货商相同)  wangning  2021-6-13
+ * @param {*} name
+ */
+export const applyInviteHdPoster = name => {
+	return https.get("/apply/invite-hd-poster", { name });
+};

+ 6 - 0
ghsApp/src/pages.json

@@ -691,6 +691,12 @@
 						"navigationBarTitleText": "邀请开店",
 						"enablePullDownRefresh": true
 					}
+				},
+        {
+					"path": "inviteShop",
+					"style": {
+						"navigationBarTitleText": ""
+					}
 				}
 			]
 		},

+ 119 - 0
ghsApp/src/pagesInvite/inviteShop.vue

@@ -0,0 +1,119 @@
+<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()">直接打开分享</button>
+      </div>
+  </view>
+</template>
+
+<script>
+import { applyInviteHdPoster } from '@/api/apply/index'
+import { getWeixinId } from "@/api/invite/index";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    return {
+      imgUrl: '',
+      getappIdList: {}
+    }
+  },
+  computed: {
+    ...mapGetters({ loginInfo: "getLoginInfo" })
+  },
+  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() {
+      applyInviteHdPoster().then(res => {
+        console.log(res)
+        this.imgUrl = res.data.imgUrl
+      }).catch(err => {})
+    },
+    goToMallPt () {
+      //查看分享的路径,不要删除 shish 20210517
+			console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
+
+			getWeixinId().then(res => {
+				uni.navigateToMiniProgram({
+					appId: res.data.hd.miniAppId,
+					path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
+					//develop 开发板 trial 体验版 release 正式版
+					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+					extraData: {
+						//'ghsShopAdminId': this.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>

+ 18 - 16
ghsApp/src/pagesInvite/list.vue

@@ -123,24 +123,26 @@ export default {
 	},
 	methods: {
 		inviteHd(){
-			
+			this.pageTo({
+        url: '/pagesInvite/inviteShop'
+      })
 			//查看分享的路径,不要删除 shish 20210517
-			console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
+			// console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
 
-			getWeixinId().then(res => {
-				uni.navigateToMiniProgram({
-					appId: res.data.hd.miniAppId,
-					path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
-					//develop 开发板 trial 体验版 release 正式版
-					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-					extraData: {
-						//'ghsShopAdminId': this.loginInfo.shopAdminId
-					},
-					success(res) {
-						// 打开成功
-					}
-				})
-			});
+			// getWeixinId().then(res => {
+			// 	uni.navigateToMiniProgram({
+			// 		appId: res.data.hd.miniAppId,
+			// 		path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
+			// 		//develop 开发板 trial 体验版 release 正式版
+			// 		envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+			// 		extraData: {
+			// 			//'ghsShopAdminId': this.loginInfo.shopAdminId
+			// 		},
+			// 		success(res) {
+			// 			// 打开成功
+			// 		}
+			// 	})
+			// });
 
 		},
 		async init() {

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

@@ -0,0 +1,9 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+/**
+ * 邀请供货商(零售、供货商相同)
+ * @param {*} name
+ */
+export const applyInviteGhsPoster = name => {
+	return https.get("/apply/invite-ghs-poster", { name });
+};

+ 7 - 0
hdApp/src/pages.json

@@ -836,6 +836,13 @@
 						"navigationBarTitleText": "邀请开店",
 						"enablePullDownRefresh": true
 					}
+				},
+        {
+					"path": "inviteShop",
+					"style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": true
+					}
 				}
 			]
 		},

+ 119 - 0
hdApp/src/pagesInvite/inviteShop.vue

@@ -0,0 +1,119 @@
+<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()">直接打开分享</button>
+      </div>
+  </view>
+</template>
+
+<script>
+import { applyInviteGhsPoster } from '@/api/apply/index'
+import { getWeixinId } from "@/api/invite/index";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    return {
+      imgUrl: '',
+      getappIdList: {}
+    }
+  },
+  computed: {
+    ...mapGetters({ loginInfo: "getLoginInfo" })
+  },
+  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() {
+      applyInviteGhsPoster().then(res => {
+        console.log(res)
+        this.imgUrl = res.data.imgUrl
+      }).catch(err => {})
+    },
+    goToMallPt () {
+      //查看分享的路径,不要删除 shish 20210517
+			console.log('pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId)
+
+			getWeixinId().then(res => {
+				uni.navigateToMiniProgram({
+					appId: res.data.ghs.miniAppId,
+					path: 'pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId,
+					//develop 开发版 trial 体验版 release 正式版
+					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+					extraData: {
+						//'hdShopAdminId': this.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>

+ 19 - 17
hdApp/src/pagesInvite/list.vue

@@ -123,24 +123,26 @@ export default {
 	},
 	methods: {
 		inviteGhs(){
+      this.pageTo({
+        url: '/pagesInvite/inviteShop'
+      })
+        //查看分享的路径,不要删除 shish 20210517
+			// console.log('pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId)
 
-			//查看分享的路径,不要删除 shish 20210517
-			console.log('pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId)
-
-			getWeixinId().then(res => {
-				uni.navigateToMiniProgram({
-					appId: res.data.ghs.miniAppId,
-					path: 'pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId,
-					//develop 开发版 trial 体验版 release 正式版
-					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-					extraData: {
-						//'hdShopAdminId': this.loginInfo.shopAdminId
-					},
-					success(res) {
-						// 打开成功
-					}
-				})
-			})
+			// getWeixinId().then(res => {
+			// 	uni.navigateToMiniProgram({
+			// 		appId: res.data.ghs.miniAppId,
+			// 		path: 'pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId,
+			// 		//develop 开发版 trial 体验版 release 正式版
+			// 		envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+			// 		extraData: {
+			// 			//'hdShopAdminId': this.loginInfo.shopAdminId
+			// 		},
+			// 		success(res) {
+			// 			// 打开成功
+			// 		}
+			// 	})
+			// })
 
 		},
 		async init() {