Commit ad422e9466a8bfba6e03643fdff5e1e3419c25b5

Authored by yvan.ni
1 parent e8a6cbaa

首页,评价有礼

packageB/pages/evaluate/evaluate.js
... ... @@ -26,6 +26,7 @@ Page({
26 26 is_act:0, //是否能购获取图片
27 27 actId:0, //活动ID
28 28 giftBagId:0, //礼包ID
  29 + ftype:0
29 30  
30 31 },
31 32 //点击星级
... ... @@ -98,8 +99,19 @@ Page({
98 99  
99 100 //查询美导信息
100 101 query_bea: function() {
101   - var th = this;
102   - var url = "/api/weshop/order/pagePosOrder";
  102 + var th = this;
  103 + var url = "/api/weshop/order/pagePosOrder";
  104 +
  105 + switch (this.data.ftype){
  106 + case 3:
  107 + break;
  108 + case 4:
  109 + url = "/api/weshop/serviceCard/pagePos";
  110 + break;
  111 + default:
  112 + break
  113 + }
  114 +
103 115 var number = th.data.number; //订单编号
104 116 getApp().request.promiseGet(url, {
105 117 data: {
... ... @@ -175,10 +187,10 @@ Page({
175 187 var url = th.data.url + "/api/weshop/evaluation/evaluate/insert";
176 188 var posNo = th.data.number; //收银单号
177 189 var proposal = th.data.proposal; //用户建议内容
178   - var fromType = th.data.fromType; //评价来源
  190 + var fromType = th.data.ftype?th.data.ftype:1; //评价来源
179 191 var json = {
180 192 "evaLabList": evaLabList,
181   - "fromType": 1,
  193 + "fromType": fromType,
182 194 "number": posNo,
183 195 "remark": proposal,
184 196 "star": stars + 1,
... ... @@ -197,9 +209,15 @@ Page({
197 209 if (res.data.code == 0) {
198 210 getApp().my_warnning("评价成功", 1, th);
199 211 var namber=th.data.number;
  212 +
  213 + var url="/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1";
  214 + if(this.data.ftype==4){
  215 + url="/pages/user/index/index";
  216 + }
  217 +
200 218 setTimeout(function() {
201 219 wx.redirectTo({
202   - url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1"
  220 + url: url
203 221 });
204 222 }, 2000);
205 223 } else {
... ... @@ -218,11 +236,17 @@ Page({
218 236 number: options.number,
219 237 //is_evaluate: options.evaluate
220 238 })
  239 +
  240 + if(options.fromtype){
  241 + this.setData({ftype:parseInt(options.fromtype)}) ;
  242 + if(options.fromtype==4) th.judge_act();
  243 + }
221 244 //th.query_bea();
222   - //th.judge_act();
  245 +
223 246 var userinfo=getApp().globalData.userInfo;
224 247 console.log("userinfo",userinfo)
225   -
  248 +
  249 +
226 250 if(!userinfo){
227 251 getApp().goto("/pages/togoin/togoin");
228 252 }
... ... @@ -260,9 +284,11 @@ Page({
260 284  
261 285 var id=this.data.actId;
262 286 var gifbagid = this.data.gifbagid;
263   - console.log(id,"订单", this.data.number),
  287 + console.log(id,"订单", this.data.number);
  288 +
  289 + var ty=this.data.ftype?this.data.ftype:2;
264 290 wx.redirectTo({
265   - url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType=2&orderNumber="+this.data.number
  291 + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number
266 292 });
267 293  
268 294 },
... ... @@ -271,10 +297,13 @@ Page({
271 297 judge_act: function () {
272 298 var th = this;
273 299 var url = "/api/weshop/marketing/comment/act/judge";
  300 +
  301 + var ty=this.data.ftype?this.data.ftype:2;
  302 +
274 303 getApp().request.promiseGet(url, {
275 304 data: {
276 305 orderNumber: th.data.number,
277   - orderType: 2,
  306 + orderType: ty,
278 307 storeId: a.stoid,
279 308 userId: d.user_id
280 309 }
... ...
packageB/pages/evaluate/evaluate.wxml
... ... @@ -94,13 +94,14 @@
94 94 </navigator>
95 95 <view wx:else>
96 96  
97   -
  97 +<block wx:if="{{ftype!=4}}">
98 98 <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt">
99 99 <view>评价其他</view>
100 100 </view>
101 101 <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt" data-status="1">
102 102 <view>查看已评价的订单</view>
103 103 </view>
  104 +</block>
104 105  
105 106 <!-- 显示来个图标 -->
106 107 <view class="show_icon" style="margin-top: 60rpx;">
... ... @@ -133,7 +134,7 @@
133 134 <view class="title">商品详情</view>
134 135 <view style="padding: 0 20rpx;">
135 136 <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}">
136   - <view>{{item.WareName}}</view>
  137 + <view>{{item.WareName?item.WareName:item.ItemName}}</view>
137 138 <view>{{item.Qty}}</view>
138 139 </view>
139 140 </view>
... ...
pages/index/index/index.js
... ... @@ -97,7 +97,7 @@ Page({
97 97 }else{
98 98 var cache_scene= wx.setStorageSync('launch');
99 99 //看一下有没有缓存,没有缓存,或者缓存的值不一样,就开始判断公众号关注组件
100   - if(!cache_scene || cache_scene!=obj.scene){
  100 + if(!cache_scene){
101 101 if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 ||
102 102 obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038 || tt.scancode_time) {
103 103 this.setData({is_ok_h5:1})
... ... @@ -108,7 +108,6 @@ Page({
108 108 }
109 109 }else{
110 110 this.setData({is_ok_h5:0})
111   - wx.setStorageSync('launch',0);
112 111 }
113 112  
114 113 }
... ...