Bladeren bron

feat:小程序分享 商品分享

DaMowang 3 jaren geleden
bovenliggende
commit
f31471e6f0

+ 5 - 5
src/pages/account/consignment.vue

@@ -252,11 +252,11 @@ import uniPopup from '@/components/uni-popup/uni-popup.vue'
 			},
 		},
 		onShareAppMessage: function () {
-		    var path = '/pages/consign-list/index?agentId=1';
-		    if (app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId) {
-		        path = '/pages/consign-list/index?agentId='+ app.globalData.systemUserInfo.userId;
-		    }
-		    		
+			let userinfo = uni.getStorageSync('userinfo');
+			var path = '/pages/account/consignment?agentId=1';
+			if (userinfo.user_id) {
+				path = '/pages/account/consignment?agentId=' + userinfo.user_id;
+			}
 		    var title = `让数字经济赋能美好生活!`;
 		    return {
 		        title: title,

+ 13 - 2
src/pages/index/index.vue

@@ -97,8 +97,7 @@ export default {
             productList: [], //商品数据
         };
     },
-    onLoad(option) {
-    },
+    onLoad(option) {},
     onLaunch() {},
     onShow() {
         this.loadData()
@@ -185,6 +184,18 @@ export default {
     },
     computed: {},
     watch: {},
+    onShareAppMessage: function () {
+        let userinfo = uni.getStorageSync('userinfo');
+        var path = '/pages/index/index?agentId=1';
+        if (userinfo.user_id) {
+            path = '/pages/index/index?agentId=' + userinfo.user_id;
+        }
+        var title = `让数字经济赋能美好生活!`;
+        return {
+            title: title,
+            path: path
+        }
+    },
 };
 </script>
 <style scoped lang='scss'>

+ 5 - 18
src/pages/product/p_details.vue

@@ -312,25 +312,12 @@ import authorizeModule from '@/components/authorize-module/index'
 			}
 		},
 		onShareAppMessage: function () {
-			let url
-			let data
-			if(this.type == 3){
-				url = '?type=3&id=' + this.id;
-				data = this.detail.title;
-			}else{
-				url = '?type=' + this.type + '&id=' + this.goodsId;
-				data = this.detail.goodsName;
+			let userinfo = uni.getStorageSync('userinfo');
+			var path = '/pages/product/p_details?agentId=1';
+			if (userinfo.user_id) {
+				path = '/pages/product/p_details?agentId=' + userinfo.user_id;
 			}
-		    var path = '/pages/szw-goods-details/index' + url;
-			
-			
-			if (app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId) {
-			    path = path + '&agentId=' + app.globalData.systemUserInfo.userId;
-			}else{
-				path = path + '&agentId=1';
-			}
-			
-		    var title = `${data}`;
+		    var title = `让数字经济赋能美好生活!`;
 		    return {
 		        title: title,
 		        path: path

+ 4 - 4
src/pages/product/productRetail.vue

@@ -158,11 +158,11 @@ export default {
         }
     },
     onShareAppMessage: function() {
-        var path = '/pages/retail-list/index?agentId=1';
-        if (app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId) {
-            path = '/pages/retail-list/index?agentId=' + app.globalData.systemUserInfo.userId;
+        let userinfo = uni.getStorageSync('userinfo');
+        var path = '/pages/product/productRetail?agentId=1';
+        if (userinfo.user_id) {
+            path = '/pages/product/productRetail?agentId=' + userinfo.user_id;
         }
-
         var title = `让数字经济赋能美好生活!`;
         return {
             title: title,

+ 13 - 13
src/pages/szw-order-list/index.vue

@@ -225,6 +225,19 @@ export default {
             this.clearData(false, this.loadData);
         },
     },
+    computed: {
+        tidyStatus() {
+            return (da) => {
+                if (da[0] === 0) return "待支付";
+                if (da[1] === 0) return "待发货";
+                if (da[1] === 1) return "待收货";
+                if (da[1] === 2) return "已收货";
+                if (da[1] === 3) return "申请退货";
+                if (da[1] === 4) return "已退货";
+                if (da[1] === 5) return "已作废";
+            };
+        },
+    },
     //上拉加载事件
     onReachBottom() {
         if (page != -1) {
@@ -243,19 +256,6 @@ export default {
             that.loadData();
         });
     },
-    computed: {
-        tidyStatus() {
-            return (da) => {
-                if (da[0] === 0) return "待支付";
-                if (da[1] === 0) return "待发货";
-                if (da[1] === 1) return "待收货";
-                if (da[1] === 2) return "已收货";
-                if (da[1] === 3) return "申请退货";
-                if (da[1] === 4) return "已退货";
-                if (da[1] === 5) return "已作废";
-            };
-        },
-    },
     onBackPress(options) {
         //避免死循环
         if (options.from === 'navigateBack') return false;