liyongli há 1 ano atrás
pai
commit
42f18e1c44

+ 11 - 1
miniprogram/config/idnex.js

@@ -1,5 +1,15 @@
+const {
+  miniProgram
+} = wx.getAccountInfoSync();
+if (miniProgram.envVersion === 'develop') {
+  miniProgram.envVersion = '-dev'
+} else if (miniProgram.envVersion === 'trial') {
+  miniProgram.envVersion = '-tri'
+} else {
+  miniProgram.envVersion = ""
+}
 module.exports = {
   client: wx.getSystemInfoSync(),
-  ...wx.getAccountInfoSync(),
+  miniProgram,
   baseurl: "https://cxzx.smcic.net/topic"
 }

+ 5 - 9
miniprogram/pages/activityDetail/index.js

@@ -53,15 +53,8 @@ Page({
     }
 
     const _this = this;
-    let url = `/Applets/shengshizhongguo/json/${options.url || 'shengshi'}`;
-    if (globalData.miniProgram.envVersion === 'develop') {
-      url += '-dev'
-    } else if (globalData.miniProgram.envVersion === 'trial') {
-      url += '-tri'
-    }
-    url += `.json?${Date.now()}`
     httpOrther({
-      url,
+      url: `/Applets/shengshizhongguo/json/${(options.url || 'shengshi') + globalData.miniProgram.envVersion}.json?${Date.now()}`,
       call(res) {
         _this.setData({
           iconList: res.list || [],
@@ -118,7 +111,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 
 })

+ 2 - 2
miniprogram/pages/detail/detail.js

@@ -88,8 +88,8 @@ Page({
    */
   onShareAppMessage: function () {
     return {
-      title: this.nameText, // 分享名称
-      path: 'pages/detail/detail?title=' + this.nameText + '&id=' + this.data.id, // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
     }
   },
 

+ 6 - 10
miniprogram/pages/home/index.js

@@ -17,15 +17,8 @@ Page({
   title: '',
   showBack() {
     const _this = this;
-    let url = '/Applets/shengshizhongguo/json/list';
-    if (globalData.miniProgram.envVersion === 'develop') {
-      url += '-dev'
-    } else if (globalData.miniProgram.envVersion === 'trial') {
-      url += '-tri'
-    }
-    url += `.json?${Date.now()}`
     httpOrther({
-      url,
+      url: `/Applets/shengshizhongguo/json/list${globalData.miniProgram.envVersion}.json?${Date.now()}`,
       call(res) {
         const defaultItem = (res.list || [])[0]
         if (!res.showList) {
@@ -117,7 +110,10 @@ Page({
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
+  onShareAppMessage: function () {
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 })

+ 5 - 2
miniprogram/pages/live/live.js

@@ -107,7 +107,10 @@ Page({
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
+  onShareAppMessage: function () {
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 })

+ 5 - 2
miniprogram/pages/livelist/index.js

@@ -91,7 +91,10 @@ Page({
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
+  onShareAppMessage: function () {
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 })

+ 1 - 1
miniprogram/pages/mediaController/index.js

@@ -100,7 +100,7 @@ Page({
 
   onShareAppMessage: function () {
     return {
-      title: this.nameText, // 分享名称
+      title: "", // 分享名称
       path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
     }
   },

+ 5 - 2
miniprogram/pages/schedule/index.js

@@ -106,7 +106,10 @@ Page({
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
+  onShareAppMessage: function () {
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 })

+ 5 - 2
miniprogram/pages/videoDetail/index.js

@@ -117,7 +117,10 @@ Page({
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
+  onShareAppMessage: function () {
+    return {
+      title: "", // 分享名称
+      path: 'pages/home/index', // 点击分享后的链接要来到的页面的路径已经对应需要的参数
+    }
   }
 })