Commit f2c47ac354315484d5066e391c14efb37c1b1b07

Authored by yvan.ni
1 parent ab63e2e4

1. 小程序添加分享页面的优化,有商品列表的都要能分享

2. 小程序plus升降级的优化
pages/activity/pind_list/pind_list.js
... ... @@ -126,12 +126,31 @@ Page({
126 126 this.reloadGoodList();
127 127 },
128 128  
129   - //---------分享配置--------
130   - onShareAppMessage: function (e) {
131   - return {
132   - title: "限时团购",
133   - }
134   - },
  129 +
  130 +
  131 + //---------分享配置--------
  132 + onShareAppMessage: function (e) {
  133 + var curPage=this;
  134 + var pagePath = curPage.route; //当前页面url
  135 + if (pagePath.indexOf('/') != 0) {
  136 + pagePath = '/' + pagePath;
  137 + }
  138 + if(getApp().globalData.user_id){
  139 +
  140 + if(pagePath.indexOf("?")>0){
  141 + pagePath+="&first_leader="+getApp().globalData.user_id;
  142 + }else{
  143 + pagePath+="?first_leader="+getApp().globalData.user_id;
  144 + }
  145 + }
  146 + return {
  147 + title: "限时团购",
  148 + path:pagePath,
  149 + }
  150 + },
  151 +
  152 +
  153 +
135 154  
136 155 //图片失败,默认图片
137 156 bind_bnerr2: function (e) {
... ...
pages/activity/pind_list/pind_list.json
1 1 {
2   - "navigationBarTitleText": "天天拼单"
  2 + "navigationBarTitleText": "天天拼单",
  3 + "usingComponents": {
  4 + "share_box": "/components/share_box/share_box"
  5 + }
3 6 }
4 7 \ No newline at end of file
... ...
pages/activity/pind_list/pind_list.wxml
... ... @@ -84,4 +84,6 @@
84 84  
85 85 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
86 86 </view>
87   -</block>
88 87 \ No newline at end of file
  88 +</block>
  89 +
  90 +<share_box id="share"></share_box>
89 91 \ No newline at end of file
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -123,12 +123,29 @@ Page({
123 123 this.setData({type:a,goodlist:null});
124 124 this.reloadGoodList();
125 125 },
126   - //---------分享配置--------
127   - onShareAppMessage: function (e) {
128   - return {
129   - title: "疯狂秒杀",
130   - }
131   - },
  126 +
  127 +
  128 + //---------分享配置--------
  129 + onShareAppMessage: function (e) {
  130 + var curPage=this;
  131 + var pagePath = curPage.route; //当前页面url
  132 + if (pagePath.indexOf('/') != 0) {
  133 + pagePath = '/' + pagePath;
  134 + }
  135 + if(getApp().globalData.user_id){
  136 +
  137 + if(pagePath.indexOf("?")>0){
  138 + pagePath+="&first_leader="+getApp().globalData.user_id;
  139 + }else{
  140 + pagePath+="?first_leader="+getApp().globalData.user_id;
  141 + }
  142 + }
  143 + return {
  144 + title: "限时秒杀",
  145 + path:pagePath,
  146 + }
  147 + },
  148 +
132 149 //图片失败,默认图片
133 150 bind_bnerr2: function (e) {
134 151 var _errImg = e.target.dataset.errorimg;
... ...
pages/activity/seckill_list/seckill_list.json
1 1 {
2   - "navigationBarTitleText": "商品秒杀"
  2 + "navigationBarTitleText": "商品秒杀",
  3 + "usingComponents": {
  4 + "share_box": "/components/share_box/share_box"
  5 + }
3 6 }
4 7 \ No newline at end of file
... ...
pages/activity/seckill_list/seckill_list.wxml
... ... @@ -73,3 +73,5 @@
73 73 </view>
74 74  
75 75 </block>
  76 +
  77 +<share_box id="share"></share_box>
... ...
pages/goods/goodsList/goodsList.wxml
... ... @@ -142,6 +142,7 @@
142 142 {{item.name}}</view>
143 143 </view>
144 144 </view>
  145 +
145 146 <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}">
146 147 <view class="filter-name">{{item.name}}</view>
147 148 <view class="filter-items">
... ...
pages/goods/search/search.js
... ... @@ -52,8 +52,7 @@ Page({
52 52 th.setData({ hotWords: arr});
53 53 }
54 54  
55   -
56   -
  55 +
57 56 //计算等级价相关
58 57 var swithc_list=rs.switch_list;
59 58 var sw_arr=JSON.parse(swithc_list);
... ... @@ -187,12 +186,29 @@ Page({
187 186 if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词");
188 187 this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
189 188 },
190   - //---------分享配置--------
191   - onShareAppMessage: function (e) {
192   - return {
193   - title: "商品分类",
194   - }
195   - },
  189 +
  190 + //---------分享配置--------
  191 + onShareAppMessage: function (e) {
  192 + var curPage=this;
  193 + var pagePath = curPage.route; //当前页面url
  194 + if (pagePath.indexOf('/') != 0) {
  195 + pagePath = '/' + pagePath;
  196 + }
  197 + if(getApp().globalData.user_id){
  198 +
  199 + if(pagePath.indexOf("?")>0){
  200 + pagePath+="&first_leader="+getApp().globalData.user_id;
  201 + }else{
  202 + pagePath+="?first_leader="+getApp().globalData.user_id;
  203 + }
  204 + }
  205 + return {
  206 + title: "商品搜索",
  207 + path:pagePath,
  208 + }
  209 + },
  210 +
  211 +
196 212 //---------图片失败,默认图片--------
197 213 bind_bnerr: function (e) {
198 214 var _errImg = e.target.dataset.errorimg;
... ...
pages/goods/search/search.json
1 1 {
2 2 "navigationBarTitleText": "商品搜索",
3   - "enablePullDownRefresh": false
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "share_box": "/components/share_box/share_box"
  6 + }
4 7 }
5 8 \ No newline at end of file
... ...
pages/goods/search/search.wxml
... ... @@ -106,6 +106,9 @@
106 106 </block>
107 107 </view>
108 108 </navigator>
  109 +
  110 + <!-- 有商品列表的时候,要有分享攻击 -->
  111 + <share_box id="share"></share_box>
109 112 </view>
110 113 <view class="no-data" wx:if="{{!requestData||requestData.length==0}}">
111 114 <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image>
... ...
pages/team/team_success/team_success.js
... ... @@ -360,7 +360,6 @@ Page({
360 360 scene+="_"+user_id;
361 361 }
362 362  
363   -
364 363 //二微码
365 364 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
366 365 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
... ...
pages/user/cardinfo/cardinfo.js
... ... @@ -842,7 +842,7 @@ Page({
842 842 if(th.data.is_guoqi){
843 843 my_con.open(" \n 温馨提示:与原等级不符,是否变更!\n\n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null)
844 844 }else{
845   - //如果是升级的话
  845 + //如果是升级的话
846 846 await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/updatePrice/get",
847 847 {data:{storeId: os.stoid,userId:getApp().globalData.user_id,OldCardId:th.data.user_card.CardId,NewCardId:card_id}}).then(res => {
848 848 if (res.data.code == 0) {
... ...
pages/user/cardinfo/cardinfo.wxml
... ... @@ -157,7 +157,7 @@
157 157 <goods_recommend id="goods_list"></goods_recommend>
158 158 <!-- 商品列表 -->
159 159 <!-- 画布 -->
160   -<canvas canvas-id='myCanvas' style="width:750rpx;height:1260rpx;"wx:if='{{!canvasHidden}}'></canvas>
  160 +<canvas canvas-id='myCanvas' style="width:750rpx;height:1260rpx;" wx:if='{{!canvasHidden}}'></canvas>
161 161  
162 162 <warn id="warn"></warn>
163 163 <my_confirm id="my_con"></my_confirm>
... ...