فهرست منبع

花店端优化开单、采购开单、新增分享

jf 5 سال پیش
والد
کامیت
dd745cd4c7

+ 12 - 2
ghsApp/src/admin/home/workbench.vue

@@ -360,12 +360,22 @@ export default {
 		getMyMall(){
 			getWeixinId().then(res => {
 				uni.navigateToMiniProgram({
+					// appId: res.data.hd.miniAppId,
+					// path: 'pagesPurchase/ghsProduct?account='+ this.loginInfo.shopId,
+					// //develop 开发板 trial 体验版 release 正式版
+					// envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+					// extraData: {
+					// 	'shopAdminId': this.loginInfo.shopAdminId
+					// },
+					//姜枫-2021.04.13
 					appId: res.data.hd.miniAppId,
-					path: 'pagesPurchase/ghsProduct?account='+ this.loginInfo.shopId,
+					path: 'admin/share/index?shopId='+ this.loginInfo.shopId,
 					//develop 开发板 trial 体验版 release 正式版
 					envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
 					extraData: {
-						'shopAdminId': this.loginInfo.shopAdminId
+						'shopId': this.loginInfo.shopId,
+						'id': 0,
+						'name': '假数据',
 					},
 					success(res) {
 						// 打开成功

+ 4 - 1
hdApp/src/App.vue

@@ -75,7 +75,10 @@ export default {
     // const url = `/${currentPage.route}`;
     // console.log(1111,url)
   },
-  onShow () {
+  onShow (extraData) {
+  	if(extraData){
+  		uni.setStorageSync('extraData',extraData)
+			}
   },
   onHide () { },
   onError (err) {

+ 39 - 0
hdApp/src/admin/share/index.vue

@@ -0,0 +1,39 @@
+<!--姜枫 2021.04.13-->
+<style lang="scss" scoped>
+.app-content {
+}
+</style>
+<template>
+  <div class="app-content">
+			<button type="default" open-type="share">点击分享</button>
+			参数展示:{{JSON.stringify(shareInfo)}}
+  </div>
+</template>
+<script>
+export default {
+  name: 'Share',
+  data () {
+    return {
+					shareInfo:'',
+    }
+  },
+	onShareAppMessage(res) {
+  	let {shopId,id,name} = this.shareInfo;
+		if (res.from === 'button') {// 来自页面内分享按钮
+			console.log(res.target)
+		}
+		return {
+			title: '自定义分享标题',
+			path: `/pagesPurchase/ghsProduct?shopId=${shopId}&id=${id}&name=${name}`
+		}
+	},
+  onLoad () {
+			if(uni.getStorageSync('extraData')){
+				this.shareInfo = uni.getStorageSync('extraData').referrerInfo.extraData;
+			}
+  },
+  methods: {
+  }
+}
+</script>
+

+ 2 - 2
hdApp/src/components/module/app-commodity.vue

@@ -34,7 +34,7 @@
 import { COMMODITY_TYPE } from "@/utils/declare";
 import AppImg from "@/components/app-img";
 import { autoPriceByIdApi, changePriceByIdApi } from '@/api/product/index'
-import productMins from "@/mixins/productContrapose";
+// import productMins from "@/mixins/productContrapose";
 import animationMins from "@/mixins/animation";
 
 import allSelectInput from "@/components/module/allSelectInput";
@@ -44,7 +44,7 @@ export default {
 	components: {
 		AppImg,allSelectInput
 	},
-	mixins: [productMins,animationMins,allSelectInputMins],
+	mixins: [animationMins,allSelectInputMins],
 	props: {
 		info: {
 			required: true,

+ 6 - 1
hdApp/src/mixins/product.js

@@ -22,10 +22,15 @@ export default {
 	},
 	onLoad(options) {
 		this.options = options;
-		const { pageType,shopId,id } = options;
+		const { pageType,shopId,id,name } = options;
 		if (pageType) {
 			this.pageType = pageType;
 		}
+		if(name){
+			uni.setNavigationBarTitle({
+				title: name
+			});
+		}
 		if (this.autoLoad) {
 			if(this.isGhsProduct){
 				this.initGhsData(id,shopId);//采购-进店下单

+ 1 - 1
hdApp/src/mixins/productContrapose.js

@@ -68,7 +68,7 @@ export default {
 		},
 		//选择商品总数
 		allCount() {
-			console.log(444444, this.selectList);
+			// console.log(444444, this.selectList);
 			return this.selectList.length;
 		},
 		/**

+ 9 - 3
hdApp/src/pages.json

@@ -49,6 +49,12 @@
 				"navigationStyle": "custom"
 			}
 		},
+		{
+			"path": "admin/share/index",
+			"style": {
+				"navigationBarTitleText": "分享"
+			}
+		},
 		{
 			"path": "common/redirect",
 			"style": {
@@ -696,7 +702,7 @@
 				},{
 					"path": "ghsProduct",
 					"style": {
-						"navigationBarTitleText": "进店开单",
+						"navigationBarTitleText": "",
 						"enablePullDownRefresh": true
 					}
 				},
@@ -715,14 +721,14 @@
 					}
 				},
         {
-					"path": "cosNext", 
+					"path": "cosNext",
 					"style": {
 						"navigationBarTitleText": "下一步",
 						"enablePullDownRefresh": true
 					}
 				},
         {
-					"path": "gatherPay", 
+					"path": "gatherPay",
 					"style": {
 						"navigationBarTitleText": "",
 						"enablePullDownRefresh": true

+ 5 - 15
hdApp/src/pagesPurchase/order.vue

@@ -32,23 +32,13 @@
               <view class="accumulative">累计采购: {{item.expendAmount}}</view>
             </view>
             <view class="store_btn">
-              <view
-                class="btn_entrance"
-                v-if="Number(item.debtAmount) <= 0"
-                @click="settleAccounts(item)"
-              >
+              <view class="btn_entrance" v-if="Number(item.debtAmount) <= 0" @click="settleAccounts(item)">
                 结账
               </view>
-              <view
-                class="btn_entrance btn_forbid"
-                v-else
-              >
+              <view class="btn_entrance btn_forbid" v-else>
                 结账
               </view>
-              <view
-                class="btn_entrance"
-                @click="enter(item)"
-              >
+              <view class="btn_entrance" @click="enter(item)">
                 进店
               </view>
             </view>
@@ -120,8 +110,8 @@ export default {
   },
   methods: {
     enter (item) {
-      const { id, ghsShopId, ghsSjId } = item
-      uni.navigateTo({ url: `/pagesPurchase/ghsProduct?shopId=${ghsShopId}&id=${id}` })
+    	const {id,ghsShopId,ghsSjId} = item
+      uni.navigateTo({url: `/pagesPurchase/ghsProduct?shopId=${ghsShopId}&id=${id}`})
     },
     getGHSList () {
       ghsList().then(res => {