Commit 3128781468dde5fe399a951ef7f5d05c36929ee3

Authored by antploy
1 parent f77f804c

oa 115574 新增分享朋友圈功能

Showing 1 changed file with 22 additions and 3 deletions
pages/template/index.js
... ... @@ -11,7 +11,7 @@ var t = getApp(),
11 11 Page({
12 12 data: {
13 13 url: os.imghost,
14   - temp_id:0,
  14 + temp_id:0,
15 15 },
16 16  
17 17 onLoad: function(e) {
... ... @@ -45,13 +45,12 @@ Page({
45 45 var data = res.data.data;
46 46 if (data) {
47 47 var temp_data = data;
48   -
49 48 wx.setNavigationBarTitle({
50 49 title: temp_data.page_title,
51 50 });
52   -
53 51 var t_arr = JSON.parse(temp_data.json_str);
54 52 th.setData({
  53 + share_title:temp_data.page_title,
55 54 template_arr: t_arr,
56 55 isTemplate: 1,
57 56 bgcolor_t: temp_data.bkcolor
... ... @@ -98,6 +97,26 @@ Page({
98 97  
99 98 },
100 99  
  100 + /**
  101 + * 用户分享朋友圈
  102 + */
  103 + async onShareTimeline(){
  104 + getApp().getConfig(await function(e){
  105 + this.setData({
  106 + store_config:e
  107 + })
  108 + }.bind(this))
  109 + var {share_title,temp_id,store_config} = this.data;
  110 + // var url= `pages/template/index?sence=${temp_id}`;
  111 + var ob = {
  112 + title:share_title,
  113 + // path: url,
  114 + query:`sence=${temp_id}`,
  115 + imageUrl:this.data.url+store_config.store_logo,
  116 + };
  117 + console.log(ob);
  118 + return ob;
  119 +},
101 120 //---加载更多是靠这个函数----
102 121 onReachBottom: function() {
103 122 if(getApp().globalData.func_list)
... ...