Commit e820453e8c6575e30bef59efb74969ffe5a3d918

Authored by season
2 parents 95209757 b32b0b80

0926版本合并

... ... @@ -19,13 +19,14 @@ App({
19 19 wuliuprice: null, //物流价格表
20 20 wuliu: null, //物流公司
21 21 baddr:null,
22   - mobile: null, //记录手机
23   - getu:null, //记录会员信息
  22 + mobile: null, //记录手机
  23 + getu:null, //记录会员信息
24 24 sessionKey: null,//记录会员信息
25 25 openid: null, //记录会员信息
26 26  
27   - to_group:null, //参团传递的数据
28   - wxapp_buy_obj:null,//微信小程序购买的Object
  27 + to_group:null, //参团传递的数据
  28 + wxapp_buy_obj:null, //微信小程序购买的Object
  29 + pk_store:null, //选择的门店
29 30  
30 31 },
31 32 auth: o,
... ... @@ -287,10 +288,43 @@ App({
287 288 },
288 289  
289 290 //显示提示,word提示内容,type 0失败,提示 1成功
290   - my_warnning(word,type,that){
  291 + my_warnning(word,type,that,width){
291 292 var warn = that.selectComponent("#warn"); //组件的id
292   - warn.open(word,type);
  293 + warn.open(word,type,width);
293 294 return 1;
  295 + },
  296 +
  297 + //获取会员门店
  298 + get_user_store:function (func)
  299 + {
  300 + var th=this;
  301 + //---空会员的情况---
  302 + if(!th.globalData.userInfo){
  303 + return func(null);
  304 + }
  305 + if(!this.globalData.pk_store){
  306 + var pick_id=0;
  307 + //先找一个会员是否有设置默认的地址
  308 + if(th.globalData.userInfo.def_pickup_id){
  309 + pick_id= th.globalData.userInfo.def_pickup_id
  310 + }
  311 + //查找会员的注册的地址
  312 + else if(th.globalData.userInfo.pickup_id){
  313 + pick_id= th.globalData.userInfo.pickup_id
  314 + }
  315 + //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
  316 + if(pick_id==0) return func(null);
  317 + //获取用户注册时候的门店
  318 + th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+this.globalData.userInfo.pickup_id,{
  319 + data:{},
  320 + success:function (res) {
  321 + th.globalData.pk_store=res.data.data;
  322 + func(th.globalData.pk_store);
  323 + }
  324 + })
  325 + }else{
  326 + func(this.globalData.pk_store);
  327 + }
294 328 }
295 329  
296 330 });
... ...
app.json
... ... @@ -71,7 +71,12 @@
71 71 "pages/user/grow_value/grow_value"
72 72  
73 73 ],
74   - "window": {
  74 + "permission": {
  75 + "scope.userLocation": {
  76 + "desc": "获取你的位置信息"
  77 + }
  78 + },
  79 + "window": {
75 80 "backgroundTextStyle": "light",
76 81 "navigationBarTextStyle": "black",
77 82 "navigationBarTitleText": "加载中...",
... ... @@ -84,6 +89,7 @@
84 89 "selectedColor": "#f23030",
85 90 "borderStyle": "white",
86 91 "backgroundColor": "#ffffff",
  92 +
87 93 "list": [
88 94 {
89 95 "pagePath": "pages/index/index/index",
... ...
app.wxss
... ... @@ -77,7 +77,7 @@ button {
77 77 .modal-close {
78 78 position: absolute;
79 79 right: 25rpx;
80   - top: 25rpx;
  80 + top:40rpx;
81 81 }
82 82 .no-data {
83 83 width: 100%;
... ... @@ -308,6 +308,17 @@ justify-content:space-around;
308 308 .xc-ash{
309 309 color: #b9b9b9;
310 310 }
  311 +.xc-ash-9f{
  312 + color: #9fa1a0;
  313 +
  314 +}
  315 +
  316 +.xc-ash_c999{
  317 +color: #999;
  318 +}
  319 +.xc-ash-b{
  320 +background: #b9b9b9;
  321 +}
311 322 .xc-black{
312 323 color: #000;
313 324 }
... ... @@ -315,6 +326,9 @@ color: #b9b9b9;
315 326 color: #333;
316 327 }
317 328  
  329 +.xc-black3{
  330 +color: #333;
  331 +}
318 332  
319 333 .xc-fixed{
320 334 position: fixed;
... ... @@ -358,6 +372,8 @@ background: #ffe3e2;
358 372 .fs40 {
359 373 font-size: 40rpx;
360 374 }
361   -.ai_and{
362   - align-items:flex-end;
  375 +
  376 +.ai_end{
  377 + align-items: flex-end;
363 378 }
  379 +
... ...
components/goods_list/goods_list.js
... ... @@ -73,7 +73,10 @@ Component({
73 73 reset:function(){
74 74 curPage=1;
75 75 },
76   -
  76 + go_url:function(e){
  77 + var url=e.currentTarget.dataset.url;
  78 + t.goto(url);
  79 + },
77 80  
78 81  
79 82 },
... ...
components/goods_list/goods_list.wxml
... ... @@ -3,13 +3,17 @@
3 3 <view class="collects">
4 4 <view class="hang ">
5 5 <!-- 商品详情 -->
  6 +
  7 +
6 8 <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
7   - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  9 +
8 10 <!-- 商品图片 -->
9 11 <image class="sp" src="{{url+item.original_img}}" mode="scaleToFill" binderror="bind_bnerr_xc" data-url="{{item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image>
10 12 <view class="bottom">
11 13 <!-- 商品名称 -->
12   - <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
  14 +
  15 + <view class="goods_name ellipsis-2 fs24">{{item.goods_name}}</view>
  16 +
13 17 <!-- 商品价格 -->
14 18 <view class="money flex">
15 19 <!-- 办卡价 -->
... ... @@ -24,7 +28,7 @@
24 28 </view>
25 29 </view>
26 30 </view>
27   - </navigator>
  31 +
28 32 </view>
29 33 </view>
30 34 <view class="nothing flex-center" wx:if="{{is_no_more==0}}">
... ...
components/goods_list/goods_list.wxss
... ... @@ -37,17 +37,16 @@ color: #b9b9b9;
37 37 -webkit-line-clamp: 2;
38 38 }
39 39 .goods_name{
40   - height: 62rpx;
  40 + height: 62rpx;
41 41 margin-top: 6rpx;
42   - line-height: 30rpx;
43   -
44   -
  42 + line-height: 30rpx
45 43 }
46 44 .hang {
47 45 width: 100%;
48 46 margin: auto;
49 47 padding-left: 21rpx;
50 48 }
  49 +
51 50 .fs28{
52 51 font-size: 28rpx;
53 52 }
... ... @@ -55,6 +54,11 @@ color: #b9b9b9;
55 54 .hang .collect {
56 55 width: 347rpx;
57 56 height: 495rpx;
  57 +}
  58 +
  59 +.hang .collect {
  60 + width: 347rpx;
  61 + height: 571rpx;
58 62 border-radius: 25rpx;
59 63 border: 1rpx solid rgb(214, 214, 214);
60 64 overflow: hidden;
... ... @@ -72,7 +76,7 @@ color: #b9b9b9;
72 76 }
73 77  
74 78 .collect .money {
75   - margin-top: 30rpx;
  79 + margin-top: 60rpx;
76 80 margin-bottom: 18rpx;
77 81 line-height: 28rpx;
78 82 align-items: baseline;
... ...
components/long_warn/long_warn.js
... ... @@ -8,12 +8,17 @@ Component({
8 8 is_show:0,
9 9 type:0, //0 提示,失败 1成功
10 10 iurl:t.globalData.setting.imghost,
  11 + width:0,
11 12 },
12 13  
13 14 methods: {
14   - open:function (e,type) {
  15 + open:function (e,type,width) {
15 16 var that=this;
16   - this.setData({is_show:1,val:e,type:type});
  17 + if(width!=undefined) {
  18 + this.setData({is_show:1,val:e,type:type,width:width});
  19 + }else{
  20 + this.setData({is_show:1,val:e,type:type});
  21 + }
17 22 setTimeout(function () {
18 23 that.setData({is_show:0});
19 24 },2000);
... ...
components/long_warn/long_warn.wxml
1 1 <view class="rim" wx:if="{{is_show}}">
2 2 <view class="content flex-center">
3   - <view class="con_view">
  3 + <view class="con_view" style="width:{{width>0?width+'rpx':'auto'}}">
4 4 <view class="con_view_img">
5 5 <image wx:if="{{type}}" src="{{iurl}}/miniapp/images/sucess_g.png"></image><!-- 成功 -->
6 6 <image wx:else src="{{iurl}}/miniapp/images/gt.png"></image> <!-- 失败 -->
... ...
pages/cart/cart/cart.wxml
... ... @@ -35,7 +35,7 @@
35 35 </block>
36 36 </view>
37 37  
38   - <view class="pay-for">
  38 + <cover-view class="pay-for">
39 39 <label bindtap="checkAll" class="checkbox">
40 40 <icon class="ico-check" color="{{checkAllToggle?'red':'gray'}}" size="20" type="success"></icon>全选
41 41 </label>
... ... @@ -45,7 +45,8 @@
45 45 </view>
46 46 <text class="tips">不包含运费</text>
47 47 </view>
48   - </view>
  48 + </cover-view>
  49 +
49 50 </view>
50 51 <view class="no-data" wx:if="{{!requestData||requestData.length==0}}">
51 52 <image class="cart-image" src="{{imgUrl}}/miniapp/images/cart-null.png"></image>
... ...
pages/cart/cart/cart.wxss
... ... @@ -107,6 +107,7 @@ page {
107 107 font-size: 28rpx;
108 108 color: #666;
109 109 background-color: #f0f2f5;
  110 + z-index: 9999999
110 111 }
111 112  
112 113 .pay-for .pay-btn {
... ...
pages/cart/cart2/cart2.wxss
... ... @@ -201,7 +201,9 @@
201 201 .btn-wrap {
202 202 height: 100rpx; width: 100%;
203 203 background-color: #fff;
204   - position: fixed; bottom: 0;left: 0
  204 + position: fixed; bottom: 0;left: 0;
  205 + border-top:1rpx solid #dee
  206 +
205 207 }
206 208  
207 209 .tips-btn {
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -21,10 +21,10 @@ var regeneratorRuntime = require(&#39;../../../utils/runtime.js&#39;);
21 21  
22 22 Page({
23 23 data: {
24   - start_stop:2,//秒杀开始 结束 的控制(1正在进行,2即将开始)
25   - color_type:0,//线条控制
26   - color_type_one:0,
27   - color_type_two:1,
  24 + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始)
  25 + color_type: 0, //线条控制
  26 + color_type_one: 0,
  27 + color_type_two: 1,
28 28  
29 29 gid: "",
30 30 stoid: o.stoid,
... ... @@ -50,7 +50,8 @@ Page({
50 50 activeCategoryId: 0,
51 51 supportPageScroll: !1,
52 52 address: {
53   - address: "", district: 0
  53 + address: "",
  54 + district: 0
54 55 },
55 56 shipping: "",
56 57 shippingCost: 0,
... ... @@ -75,29 +76,30 @@ Page({
75 76 }],
76 77 activeCategoryId3: 1,
77 78 categories3: [{
78   - name: "全部",
79   - id: 1,
80   - num: 0
81   - },
82   - {
  79 + name: "全部",
  80 + id: 1,
  81 + num: 0
  82 + },
  83 + {
83 84 name: "有图",
84 85 id: 5,
85 86 num: 0
86 87 },
87 88  
88 89 {
89   - name: "好评",
90   - id: 2,
91   - num: 0
92   - }, {
93   - name: "中评",
94   - id: 3,
95   - num: 0
96   - }, {
97   - name: "差评",
98   - id: 4,
99   - num: 0
100   - }, ],
  90 + name: "好评",
  91 + id: 2,
  92 + num: 0
  93 + }, {
  94 + name: "中评",
  95 + id: 3,
  96 + num: 0
  97 + }, {
  98 + name: "差评",
  99 + id: 4,
  100 + num: 0
  101 + },
  102 + ],
101 103  
102 104 select: {
103 105 price: 0,
... ... @@ -119,7 +121,12 @@ Page({
119 121 is_show_sto_cat: 1, //是否显示门店分类
120 122 only_pk: null,
121 123 all_sto: null,
122   - sec_sto: null,
  124 + sec_sto: null, //选择了的门店分类
  125 + pickpu_list: null, //读出的所有门店list
  126 + def_pickpu_list: null, //一开始5个门店list
  127 + sec_pick_index: 0, //第二级门店选择ID
  128 + fir_pick_index: 0, //第一级门店选择ID
  129 +
123 130 //同一条形码的所有商品
124 131 sku_g: null,
125 132 sku_g_pt: null, //---拼单的普通购买---
... ... @@ -142,17 +149,17 @@ Page({
142 149 prom_start_time: null,
143 150 prom_act: null,
144 151 pd_xx: 0,
145   - is_normal: 0, //是否普通购买
146   - teamgroup:null, //有多少人开团
147   - grounp_tatal:0, //有几个人开团
148   - timer:[],
  152 + is_normal: 0, //是否普通购买
  153 + teamgroup: null, //有多少人开团
  154 + grounp_tatal: 0, //有几个人开团
  155 + timer: [],
149 156  
150 157 //商品的购买次数
151 158 prom_buy_num: -1,
152 159 g_buy_num: null,
153   - prom_goods_num:0, //活动商品数量
154   - prom_buy_num:0, //活动商品购买数量
155   - prom_redis_num:0, //活动商品redis数量
  160 + prom_goods_num: 0, //活动商品数量
  161 + prom_buy_num: 0, //活动商品购买数量
  162 + prom_redis_num: 0, //活动商品redis数量
156 163  
157 164 //拼单的规则显示
158 165 is_show_gz: 0,
... ... @@ -164,99 +171,167 @@ Page({
164 171 openSpecModal_ind: 0,
165 172  
166 173 //---计时器开关----
167   - is_timer:1,
168   - isshow:0,
169   - bconfig:null, //基础配置
  174 + is_timer: 1,
  175 + isshow: 0,
  176 + bconfig: null, //基础配置
170 177  
171   - fir_comments:null, //详情页上的评价
172   - fir_quan:null, //详情页上的券
173   - quan_list:null, //券列表
  178 + fir_comments: null, //详情页上的评价
  179 + fir_quan: null, //详情页上的券
  180 + quan_list: null, //券列表
174 181  
175   - coupon:0,
  182 + coupon: 0,
176 183 //会员分享的头像
177   - share_head:"",
178   - share_goods_img:"",
  184 + share_head: "",
  185 + share_goods_img: "",
179 186  
180 187 //----------视频图片data参数---------
181   - current: 0,//图片计数
182   - swiperCurrent:0,//轮播的下标
183   - hiddenn:0,//控制轮播计数显示
  188 + current: 0, //图片计数
  189 + swiperCurrent: 0, //轮播的下标
  190 + hiddenn: 0, //控制轮播计数显示
184 191  
185   - currentTab: 0,// 选择器控制参数
  192 + currentTab: 0, // 选择器控制参数
186 193 mapurl: "",
187   - mapurl_f_img:"",
188   - videopicture: 0,//视频图片的控制
  194 + mapurl_f_img: "",
  195 + videopicture: 0, //视频图片的控制
189 196  
190   - video: 0,//视频图片切换器
  197 + video: 0, //视频图片切换器
191 198 index: 0,
192   - noon: 0,//开始视频的隐藏
  199 + noon: 0, //开始视频的隐藏
193 200  
194   - screenWidth:0,
195   - canvasHidden:1,
  201 + screenWidth: 0,
  202 + canvasHidden: 1,
196 203  
197 204 //--推荐--
198   - recommend_list:[],
199   - store_config:null,
200   - is_show_pl:0, //是否品类
201   - is_show_pp:0, //是否品牌
202   - is_show_gb:0, //是否国别
203   - is_closecoupon:0,
  205 + recommend_list: [],
  206 + store_config: null,
  207 + is_show_pl: 0, //是否品类
  208 + is_show_pp: 0, //是否品牌
  209 + is_show_gb: 0, //是否国别
  210 + is_closecoupon: 0,
204 211  
205 212 //是否点赞中
206 213 iszaning: 0,
  214 +
  215 + select_store: 0, //选择更多
  216 + index: 1,
  217 + more_store: 0, //选择门店
  218 + sort_store: 0, //门店分类
  219 + choice_sort_store: 0, //选择分类门店
  220 + new_user: 0, //新用户
  221 +
  222 + def_pick_store: null, // 默认的门店
  223 + lat: null, //维度
  224 + lon: null, //经度
  225 +
  226 + is_get_local_ok: 0, //获取坐标是否完成
  227 + region_name: "门店分类", //区域的名字
  228 + is_gps: 1,
  229 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  230 + default_store: {}, //创建添加默认门店地址的对象
  231 +
  232 + comments_no_more:0,
  233 + get_c:0,
207 234 },
208 235  
209 236 //------初始化加载----------
210 237 onLoad: function(t) {
211   - wx.setNavigationBarTitle({ title: "商品详情",})
212   - var ee = this, that=ee,th=ee,
  238 + wx.setNavigationBarTitle({
  239 + title: "商品详情",
  240 + })
  241 + var ee = this,
  242 + that = ee,
  243 + th = ee,
213 244 gid = t.goods_id;
214 245  
215   - //如果tg_id是空的话,分享回来
  246 + //---获取手机地址坐标--
  247 + //--如果tg_id是空的话,分享回来--
216 248 if (gid == undefined || gid == null || gid == "") {
217 249 gid = decodeURIComponent(t.scene);
218 250 }
219   -
220 251 ee.setData({
221 252 gid: gid
222 253 });
223 254  
224   - getApp().getConfig2(function (e) {
225   - if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); }
226   - if (e.categoryset.indexOf("," + 3 + ",") != -1) { ee.setData({ is_show_pp: 1 }); }
227   - if (e.categoryset.indexOf("," + 2 + ",") != -1) { ee.setData({ is_show_gb: 1 }); }
228   -
229   - var json_d = JSON.parse(e.switch_list);
230   - ee.setData({ store_config: e, is_closecoupon: json_d.is_closecoupon });
231   - ee.init(gid);
232   - //------几人评价-------
233   - n.init(th, "", "comments");
234   - th.requestCardNum(), wx.pageScrollTo && th.setData({
235   - supportPageScroll: !0
  255 + //----获取系统参数-----
  256 + getApp().getConfig2(function(e) {
  257 + ee.setData({
  258 + bconfig: e
  259 + });
  260 +
  261 + if (e.categoryset.indexOf("," + 1 + ",") != -1) {
  262 + ee.setData({
  263 + is_show_pl: 1
  264 + });
  265 + }
  266 + if (e.categoryset.indexOf("," + 3 + ",") != -1) {
  267 + ee.setData({
  268 + is_show_pp: 1
236 269 });
  270 + }
  271 + if (e.categoryset.indexOf("," + 2 + ",") != -1) {
  272 + ee.setData({
  273 + is_show_gb: 1
  274 + });
  275 + }
237 276  
238   - })
  277 + var json_d = JSON.parse(e.switch_list);
  278 + ee.setData({
  279 + store_config: e,
  280 + is_closecoupon: json_d.is_closecoupon
  281 + });
  282 + ee.init(gid);
  283 + //------几人评价-------
  284 + //n.init(th, "", "comments");
  285 +
  286 + th.requestCardNum(), wx.pageScrollTo && th.setData({
  287 + supportPageScroll: !0
  288 + });
239 289  
  290 + });
240 291  
241 292 //获取用户设备信息,屏幕宽度
242 293 wx.getSystemInfo({
243 294 success: res => {
244   - that.setData({ screenWidth: res.screenWidth })
  295 + that.setData({
  296 + screenWidth: res.screenWidth
  297 + })
245 298 }
246   - })
  299 + });
  300 +
  301 + //获取用户的默认门店
  302 + getApp().get_user_store(function(e) {
  303 + var w_time = setInterval(function() {
  304 + if (that.data.is_get_local_ok == 0) return false;
  305 + var distance = null;
  306 + if (that.data.lat != null && e.distance == undefined) {
  307 + //distance=Math.sqrt((e.lat-th.data.lat)*(e.lat-th.data.lat)+(e.lon-th.data.lon)* (e.lon-th.data.lon));
  308 + var distance = ut.getDistance(e.lat, th.data.lat, e.lon, th.data.lon);
  309 + e.distance = distance;
  310 + }
  311 + if (e) that.setData({
  312 + def_pick_store: e,
  313 + sto_sele_name: e.pickup_name,
  314 + sto_sele_id: e.pickup_id,
  315 + sto_sele_distr: e.distr_type
  316 + })
  317 + clearInterval(w_time);
  318 + }, 500)
  319 + });
  320 +
247 321 },
248 322  
249 323 //------------程序初始化入口-------------
250 324 async init(gid) {
251   - var ee = this,th=ee,
  325 + var ee = this,
  326 + th = ee,
252 327 gallery = null,
253 328 is_collect = 0,
254 329 collect_id = 0,
255 330 categories3 = ee.data.categories3,
256   - fir_com=null,
257   - fir_quan=null,
258   - mapurl=null,
259   - mapurl_f_img=null;
  331 + fir_com = null,
  332 + fir_quan = null,
  333 + mapurl = null,
  334 + mapurl_f_img = null;
260 335  
261 336  
262 337 //------图片滚动----------
... ... @@ -335,42 +410,43 @@ Page({
335 410 goods_id: gid,
336 411 pageSize: 3,
337 412 parent_id: 0,
338   - page:1
  413 + page:1,
  414 + is_show:1,
339 415 },
340 416 }).then(res => {
341   - fir_com=res.data.data.pageData;
  417 + fir_com = res.data.data.pageData;
342 418 })
343 419  
344   - if(fir_com){
345   - for(var ind in fir_com){
346   - if(fir_com[ind].head_pic=="") fir_com[ind].head_pic= ee.data.iurl+"/miniapp/images/hui_hear_pic.png";
347   - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
348   - }
  420 + if (fir_com) {
  421 + for (var ind in fir_com) {
  422 + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";
  423 + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
  424 + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
  425 + }
349 426 }
350 427  
351   - if (th.data.is_closecoupon!=1){
  428 + if (th.data.is_closecoupon != 1) {
352 429 //----获取详情页的券的数量----
353 430 await getApp().request.promiseGet("/api/weshop/prom/coupon/page", {
354 431 data: {
355 432 store_id: os.stoid,
356   - type:1,
  433 + type: 1,
357 434 pageSize: 3,
358   - page:1,
  435 + page: 1,
359 436 },
360 437 }).then(res1 => {
361   - fir_quan=res1.data.data.pageData;
  438 + fir_quan = res1.data.data.pageData;
362 439 })
363 440 }
364 441  
365   -
366 442 //--------获取视频图片---------
367   - await getApp().request.promiseGet("/api/weshop/goodsVideos/get/"+os.stoid+"/"+ee.data.gid, {
368   - 1:1
  443 + await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
  444 + 1: 1
369 445 }).then(res1 => {
370   - if(res1.data.code==0){
371   - mapurl=res1.data.data.video_url;
372   - mapurl_f_img=res1.data.data.video_img;
373   - }
  446 + if (res1.data.code == 0) {
  447 + mapurl = res1.data.data.video_url;
  448 + mapurl_f_img = res1.data.data.video_img;
  449 + }
374 450 })
375 451  
376 452 ee.setData({
... ... @@ -378,19 +454,12 @@ Page({
378 454 is_collect: is_collect,
379 455 collect_id: collect_id,
380 456 categories3: categories3,
381   - fir_quan:fir_quan,
382   - fir_comments:fir_com,
383   - mapurl_f_img:mapurl_f_img,
384   - mapurl:mapurl,
  457 + fir_quan: fir_quan,
  458 + fir_comments: fir_com,
  459 + mapurl_f_img: mapurl_f_img,
  460 + mapurl: mapurl,
385 461 });
386 462  
387   - //获取系统参数
388   - getApp().getConfig2(function (conf) {
389   - ee.setData({
390   - bconfig:conf,
391   - })
392   - });
393   -
394 463 ee.requestRecommend();
395 464  
396 465 },
... ... @@ -398,8 +467,13 @@ Page({
398 467 //---展示---
399 468 onShow: function() {
400 469  
401   - this.data.is_timer=1;
402   - var ee = this,gid = this.data.gid,i=getApp().request;
  470 + this.data.is_timer = 1;
  471 + var ee = this,
  472 + gid = this.data.gid,
  473 + i = getApp().request;
  474 +
  475 + this.wait_for_store_config();
  476 +
403 477 i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
404 478 failRollback: !0,
405 479 success: function(t) {
... ... @@ -445,7 +519,7 @@ Page({
445 519 if (t.data.data.original_img.indexOf(o.imghost) == -1)
446 520 t.data.data.original_img = o.imghost + t.data.data.original_img;
447 521  
448   - if(t.data.data.goods_content==null) t.data.data.goods_content="";
  522 + if (t.data.data.goods_content == null) t.data.data.goods_content = "";
449 523  
450 524 //-----商品详情---
451 525 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
... ... @@ -474,12 +548,14 @@ Page({
474 548 t.data.data.gg = gg;
475 549 var uu = [];
476 550 uu.push(t.data.data);
477   - ee.setData({ sku_g: uu,});
  551 + ee.setData({
  552 + sku_g: uu,
  553 + });
478 554 }
479 555 ee.data.g_buy_num = new Map();
480 556 ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id);
481 557  
482   - var th=ee;
  558 + var th = ee;
483 559 if (ee.data.cat_name == '') {
484 560 //过去国别,分类,品牌的名称
485 561 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
... ... @@ -521,6 +597,8 @@ Page({
521 597 });
522 598 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
523 599  
  600 +
  601 +
524 602 },
525 603 enterAddress: function() {
526 604 this.data.enterAddressPage = !0, wx.navigateTo({
... ... @@ -528,8 +606,8 @@ Page({
528 606 });
529 607 },
530 608 onUnload: function() {},
531   - onHide:function(){
532   - this.data.is_timer=0;
  609 + onHide: function() {
  610 + this.data.is_timer = 0;
533 611 },
534 612 //----------三个选项按钮-----------
535 613 tabClick: function(t) {
... ... @@ -550,9 +628,9 @@ Page({
550 628 e.data.c_curr_p = 1;
551 629 this.setData({
552 630 activeCategoryId3: t.currentTarget.id,
553   - comments: null
  631 + comments: null,comments_no_more:0,get_c:0,
554 632 });
555   - this.requestComments();
  633 + this.requestComments_new();
556 634 }
557 635 },
558 636  
... ... @@ -564,13 +642,14 @@ Page({
564 642  
565 643 tabComment: function() {
566 644 this.setData({
567   - activeCategoryId: 2
568   - }), this.data.comments || this.requestComments();
  645 + activeCategoryId: 2,comments_no_more:0,get_c:0
  646 + }), this.data.comments || this.requestComments_new();
569 647 },
570 648  
571 649 //商品详情的时候调用
572 650 tabGoodsContent: function() {
573   - var th = this,i=getApp().request;
  651 + var th = this,
  652 + i = getApp().request;
574 653 this.setData({
575 654 activeCategoryId: 1
576 655 });
... ... @@ -613,14 +692,16 @@ Page({
613 692 },
614 693  
615 694 //获取redis中的数量
616   - async getactLen(func){
617   - var r_num=0,prom_type=this.data.prom_type,prom_id=this.data.prom_id;
618   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  695 + async getactLen(func) {
  696 + var r_num = 0,
  697 + prom_type = this.data.prom_type,
  698 + prom_id = this.data.prom_id;
  699 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
619 700 1: 1
620 701 }).then(res => {
621 702 var em = res;
622 703 if (em.data.code == 0) {
623   - r_num=em.data.data;
  704 + r_num = em.data.data;
624 705 }
625 706 })
626 707 func(r_num);
... ... @@ -628,29 +709,36 @@ Page({
628 709  
629 710 //------------加入购物车--------------
630 711 addCart: function(t) {
631   - var th=this;
  712 + var th = this;
  713 + var ind = t.currentTarget.dataset.openSpecModal_ind;
  714 + th.setData({
  715 + open_ind_store: ind
  716 + });
632 717 //如果是秒杀的话,要看redis够不够
633   - if(this.data.prom_type==1){
634   - this.getactLen(function (num) {
635   - if(num<th.data.goodsInputNum) {
636   - getApp().my_warnning("秒杀库存不足!",0,th);
637   - return false;
638   - }else{
639   - th.add_cart_func(t);
640   - }
641   - });
642   - }else{
  718 + if (this.data.prom_type == 1) {
  719 + this.getactLen(function(num) {
  720 + if (num < th.data.goodsInputNum) {
  721 + getApp().my_warnning("秒杀库存不足!", 0, th);
  722 + return false;
  723 + } else {
  724 + th.add_cart_func(t);
  725 + }
  726 + });
  727 + } else {
643 728 th.add_cart_func(t);
644 729 }
645 730 },
646 731 //加入购物的函数
647   - add_cart_func:function(t){
648   - var i=getApp().request;
  732 + add_cart_func: function(t) {
  733 + var i = getApp().request;
649 734 if (oo.user_id == null) {
650   - return s.my_warnning("还未登录!",0,this);
  735 + return s.my_warnning("还未登录!", 0, this);
651 736 }
652   - var e = this,th = e,a = 0,o = this.data.sele_g;
653   - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th);
  737 + var e = this,
  738 + th = e,
  739 + a = 0,
  740 + o = this.data.sele_g;
  741 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
654 742 a = o.goods_id;
655 743  
656 744 //----------添加到购物车时,要判断限购数量,--------
... ... @@ -676,13 +764,13 @@ Page({
676 764 }
677 765 }
678 766  
679   - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th);
680   - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th);
  767 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  768 + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th);
681 769 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
682 770 this.setData({
683 771 sto_sele_name: ""
684 772 });
685   - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th);
  773 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
686 774  
687 775 //--------------此时操作的数据------------
688 776 var newd = {
... ... @@ -701,8 +789,8 @@ Page({
701 789 //-----如果是秒杀,团购,积分购,拼团-----
702 790 if (th.data.prom_type == 1) {
703 791 newd.goods_price = th.data.prom_price;
704   - newd.member_goods_price= th.data.prom_price,
705   - newd.prom_type = th.data.prom_type;
  792 + newd.member_goods_price = th.data.prom_price,
  793 + newd.prom_type = th.data.prom_type;
706 794 newd.prom_id = th.data.prom_id;
707 795 } else if (th.data.prom_type == 3) {
708 796 newd.prom_type = 0;
... ... @@ -723,43 +811,34 @@ Page({
723 811 //-------如果购物车中有相关的数据---------
724 812 if (re.data.data.total > 0) {
725 813 var item = re.data.data.pageData[0];
726   -
727   -
728 814 var updata = {
729 815 id: item.id,
730 816 goods_num: e.data.goodsInputNum + item.goods_num,
731   - goods_price: newd.shop_price,
  817 + goods_price: newd.goods_price,
  818 + store_id: th.data.stoid,
732 819 };
733 820  
734 821 i.put("/api/weshop/cart/update", {
735 822 data: updata,
736 823 success: function(t) {
737   - wx.showModal({
738   - title: "添加成功!",
739   - cancelText: "去购物车",
740   - confirmText: "再逛逛",
741   - success: function(t) {
742   - t.cancel ? wx.switchTab({
743   - url: "/pages/cart/cart/cart"
744   - }) : e.requestCardNum();
745   - }
  824 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  825 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  826 + th.setData({
  827 + cartGoodsNum: c_num
746 828 });
  829 + th.closeSpecModal();
747 830 }
748 831 });
749 832 } else {
750 833 i.post("/api/weshop/cart/save", {
751 834 data: newd,
752 835 success: function(t) {
753   - wx.showModal({
754   - title: "添加成功!",
755   - cancelText: "去购物车",
756   - confirmText: "再逛逛",
757   - success: function(t) {
758   - t.cancel ? wx.switchTab({
759   - url: "/pages/cart/cart/cart"
760   - }) : e.requestCardNum();
761   - }
  836 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  837 + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;
  838 + th.setData({
  839 + cartGoodsNum: c_num
762 840 });
  841 + th.closeSpecModal();
763 842 }
764 843 });
765 844 }
... ... @@ -815,11 +894,10 @@ Page({
815 894 this.checkCartNum(Number(t.detail.value));
816 895 },
817 896  
818   -
819 897 //------检查数量是不是超出限购------
820 898 checkCartNum: function(t) {
821 899 var th = this;
822   - this.get_buy_num(this.data.sele_g,async function() {
  900 + this.get_buy_num(this.data.sele_g, async function() {
823 901  
824 902 //--判断商品是否超出限购--
825 903 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
... ... @@ -833,7 +911,7 @@ Page({
833 911  
834 912 //--判断商品是否超出活动限购--
835 913 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
836   - if (t + th.data.prom_buy_num >th.data.prom_buy_limit) {
  914 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
837 915 wx.showModal({
838 916 title: '超出商品活动限购',
839 917 });
... ... @@ -841,20 +919,22 @@ Page({
841 919 }
842 920 }
843 921  
844   - if(th.data.sele_g.prom_type==1 || th.data.sele_g.prom_type==6 ){
845   - var redis_num=0;
846   - //------判断活动是否抢光-----
847   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/"
848   - + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
849   - 1:1
  922 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  923 + var redis_num = 0;
  924 + //------判断活动是否抢光-----
  925 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  926 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  927 + 1: 1
850 928 }).then(res => {
851   - redis_num=res.data.data;
852   - });
  929 + redis_num = res.data.data;
  930 + });
853 931  
854   - if(t>redis_num){
855   - wx.showModal({ title: '超出商品活动库存', });
856   - return false;
857   - }
  932 + if (t > redis_num) {
  933 + wx.showModal({
  934 + title: '超出商品活动库存',
  935 + });
  936 + return false;
  937 + }
858 938  
859 939 }
860 940  
... ... @@ -866,7 +946,6 @@ Page({
866 946 })
867 947 },
868 948  
869   -
870 949 closeSpecModal: function() {
871 950 this.setData({
872 951 openSpecModal: !1,
... ... @@ -874,10 +953,20 @@ Page({
874 953 });
875 954 },
876 955 openSpecModel: function(t) {
  956 + var open_store = t.currentTarget.dataset.ind;
  957 +
  958 + this.setData({
  959 + store: 0,
  960 + choice_sort_store: 0,
  961 + sort_store: 0,
  962 + open_ind_store: open_store,
  963 + })
877 964 //--先判断会员状态--
878   - var user_info=getApp().globalData.userInfo;
879   - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){
880   - wx.navigateTo({ url: '/pages/getphone/getphone', })
  965 + var user_info = getApp().globalData.userInfo;
  966 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  967 + wx.navigateTo({
  968 + url: '/pages/getphone/getphone',
  969 + })
881 970 return false;
882 971 }
883 972  
... ... @@ -889,10 +978,11 @@ Page({
889 978 },
890 979 //---------点击收藏和不收藏------------
891 980 collectGoods: function() {
892   - var t = this,i=getApp().request;
  981 + var t = this,
  982 + i = getApp().request;
893 983 var user_id = s.globalData.user_id;
894 984 if (user_id == '') {
895   - getApp().getUserFir(function () {});
  985 + getApp().getUserFir(function() {});
896 986 getApp().showWarning("未登录");
897 987 return false;
898 988 } else {
... ... @@ -901,7 +991,8 @@ Page({
901 991 success: function(e) {
902 992 if (e.data.code == 0) {
903 993 t.setData({
904   - is_collect: 0,collect_id: 0,
  994 + is_collect: 0,
  995 + collect_id: 0,
905 996 });
906 997 }
907 998 }
... ... @@ -933,21 +1024,21 @@ Page({
933 1024 //---------联系客服------------
934 1025 contactService: function() {
935 1026 s.getConfig(function(t) {
936   - if(t.store_tel==undefined){
937   - getApp().request.get("/api/weshop/store/get/" + os.stoid,{
938   - isShowLoading:1,
939   - data:{},
940   - success:function (rs) {
941   - getApp().globalData.config = rs.data.data;
942   - if(rs.data.data.store_tel==null && rs.data.data.store_tel==undefined ){
943   - getApp().my_warnning("商家未设置电话",0,th);
944   - return false;
945   - }
946   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
947   - }
948   - })
949   - }else{
950   - s.confirmBox("请联系客服:" + t.store_tel);
  1027 + if (t.store_tel == undefined) {
  1028 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  1029 + isShowLoading: 1,
  1030 + data: {},
  1031 + success: function(rs) {
  1032 + getApp().globalData.config = rs.data.data;
  1033 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  1034 + getApp().my_warnning("商家未设置电话", 0, th);
  1035 + return false;
  1036 + }
  1037 + s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  1038 + }
  1039 + })
  1040 + } else {
  1041 + s.confirmBox("请联系客服:" + t.store_tel);
951 1042 }
952 1043 });
953 1044 },
... ... @@ -970,6 +1061,7 @@ Page({
970 1061 }
971 1062 });
972 1063 },
  1064 +
973 1065 previewCommentImgs: function(t) {
974 1066 var e = this.data.comments[t.currentTarget.dataset.cidx].img;
975 1067 wx.previewImage({
... ... @@ -977,6 +1069,15 @@ Page({
977 1069 urls: e
978 1070 });
979 1071 },
  1072 +
  1073 + previewCommentImgs_w: function(t) {
  1074 + var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;
  1075 + wx.previewImage({
  1076 + current: e[t.currentTarget.dataset.id],
  1077 + urls: e
  1078 + });
  1079 + },
  1080 +
980 1081 previewGoodsCommentImgs: function(t) {
981 1082 var e = this,
982 1083 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
... ... @@ -1025,7 +1126,7 @@ Page({
1025 1126 bind_bnerr: function(e) {
1026 1127 var _errImg = e.target.dataset.errorimg;
1027 1128 var _errObj = {};
1028   - _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif";
  1129 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
1029 1130 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1030 1131 },
1031 1132  
... ... @@ -1034,7 +1135,7 @@ Page({
1034 1135  
1035 1136 var _errImg = e.target.dataset.errorimg;
1036 1137 var _errObj = {};
1037   - _errObj[_errImg] = this.data.iurl+"/miniapp/images/hui_hear_pic.png"
  1138 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/hui_hear_pic.png"
1038 1139 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1039 1140 },
1040 1141  
... ... @@ -1095,77 +1196,132 @@ Page({
1095 1196 //-----------选择属性的按钮事件----------
1096 1197 sele_spec: function(e) {
1097 1198 var gid = e.currentTarget.dataset.gid;
1098   - var sku_g=this.data.sku_g;
1099   - var item=null;
1100   - for(var i in sku_g){
1101   - if(sku_g[i].goods_id==gid){item=sku_g[i]; break}
  1199 + var sku_g = this.data.sku_g;
  1200 + var item = null;
  1201 + for (var i in sku_g) {
  1202 + if (sku_g[i].goods_id == gid) {
  1203 + item = sku_g[i];
  1204 + break
  1205 + }
1102 1206 }
1103   - if(item) this.setData({sele_g:item,gid:gid});
  1207 + if (item) this.setData({
  1208 + sele_g: item,
  1209 + gid: gid
  1210 + });
1104 1211 },
1105 1212 //---------拿出门店分类和门店------------
1106   - async get_sto(e) {
1107   - var th = this, dd = null,i=getApp().request;
1108   - var g_distr_type = this.data.data.distr_type;
1109   - if (g_distr_type != 0) {
1110   - dd = {
1111   - store_id: o.stoid,
1112   - distr_type: g_distr_type,
1113   - isstop: 0,
1114   - pageSize: 300
  1213 + get_sto(e) {
  1214 + var th = this;
  1215 + var timer_get = setInterval(function() {
  1216 + if (th.data.is_get_local_ok == 0) return false;
  1217 + var dd = null,
  1218 + i = getApp().request;
  1219 + var g_distr_type = th.data.data.distr_type;
  1220 + if (g_distr_type != 0) {
  1221 + dd = {
  1222 + store_id: o.stoid,
  1223 + distr_type: g_distr_type,
  1224 + isstop: 0,
  1225 + pageSize: 300
  1226 + }
  1227 + } else {
  1228 + dd = {
  1229 + store_id: o.stoid,
  1230 + isstop: 0,
  1231 + pageSize: 300
  1232 + }
1115 1233 }
1116   - } else {
1117   - dd = {
1118   - store_id: o.stoid,
1119   - isstop: 0,
1120   - pageSize: 300
  1234 + //如果有距离的话
  1235 + if (th.data.lat != null) {
  1236 + dd.lat = th.data.lat;
  1237 + dd.lon = th.data.lon;
1121 1238 }
1122   - }
1123   - //----------获取门店----------------
1124   - await getApp().request.promiseGet("/api/weshop/pickup/list", {
1125   - data: dd,
1126   - }).then(res => {
1127   - var e = res;
1128   - if (e.data.code == 0) {
1129   - //单总量超出5个的时候
1130   - if (e.data.data.total > 5) {
1131   - i.get("/api/weshop/storagecategory/page", {
1132   - data: {
1133   - store_id: o.stoid,
1134   - is_show: 1,
1135   - pageSize: 300
1136   - },
1137   - success: function(ee) {
1138   - if (ee.data.code == 0) {
1139   - if (ee.data.data.pageData.length > 0) {
1140   - var sto_cate = ee.data.data.pageData;
1141   - var sto_arr = e.data.data.pageData;
1142   - var newarr = new Array();
1143   - var qita = new Array();
1144   - //----要进行门店分组--------
1145   - for (var i = 0; i < sto_arr.length; i++) {
1146   - //找一下这个门店有没有在分类数组内
1147   - var find2 = 0,
1148   - find2name = "";
1149   - for (var m = 0; m < sto_cate.length; m++) {
1150   - if (sto_arr[i].category_id == sto_cate[m].cat_id) {
1151   - find2 = sto_cate[m].cat_id;
1152   - find2name = sto_cate[m].cat_name;
1153   - break;
1154   - }
  1239 + clearInterval(timer_get);
  1240 + //----------获取门店----------------
  1241 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  1242 + data: dd,
  1243 + }).then(res => {
  1244 + var e = res;
  1245 + if (e.data.code == 0) {
  1246 + //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
  1247 + if (th.data.def_pick_store) {
  1248 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  1249 + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
  1250 + e.data.data.pageData.splice(k, 1); //删除
  1251 + break;
  1252 + }
  1253 + }
  1254 + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
  1255 + }
  1256 +
  1257 + //单总量超出5个的时候
  1258 + if (e.data.data.total > 5) {
  1259 + i.get("/api/weshop/storagecategory/page", {
  1260 + data: {
  1261 + store_id: o.stoid,
  1262 + is_show: 1,
  1263 + pageSize: 300
  1264 + },
  1265 + success: function(ee) {
  1266 + if (ee.data.code == 0) {
  1267 + if (ee.data.data.pageData.length > 0) {
  1268 + var def_arr = new Array();
  1269 + var ishas = 0;
  1270 + //-- 开始就看5个门店 --
  1271 + for (var k = 0; k < 5; k++) {
  1272 + if (k == e.data.data.pageData.length) break;
  1273 + def_arr.push(e.data.data.pageData[k]);
1155 1274 }
1156 1275  
1157   - if (newarr.length > 0) {
1158   - var find = 0;
1159   - //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
1160   - if (find2 != 0) {
1161   - for (var ii = 0; ii < newarr.length; ii++) {
1162   - if (sto_arr[i].category_id == newarr[ii].cat_id) {
1163   - newarr[ii].s_arr.push(sto_arr[i]);
1164   - find = 1;
1165   - break;
  1276 + th.setData({
  1277 + def_pickpu_list: def_arr,
  1278 + pickpu_list: ee.data.data.pageData
  1279 + });
  1280 + var sto_cate = ee.data.data.pageData;
  1281 + var sto_arr = e.data.data.pageData;
  1282 + var newarr = new Array();
  1283 + var qita = new Array();
  1284 +
  1285 + //----要进行门店分组--------
  1286 + for (var i = 0; i < sto_arr.length; i++) {
  1287 + //找一下这个门店有没有在分类数组内
  1288 + var find2 = 0,
  1289 + find2name = "";
  1290 + for (var m = 0; m < sto_cate.length; m++) {
  1291 + if (sto_arr[i].category_id == sto_cate[m].cat_id) {
  1292 + find2 = sto_cate[m].cat_id;
  1293 + find2name = sto_cate[m].cat_name;
  1294 + break;
  1295 + }
  1296 + }
  1297 +
  1298 + if (newarr.length > 0) {
  1299 + var find = 0;
  1300 + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
  1301 + if (find2 != 0) {
  1302 + for (var ii = 0; ii < newarr.length; ii++) {
  1303 + if (sto_arr[i].category_id == newarr[ii].cat_id) {
  1304 + newarr[ii].s_arr.push(sto_arr[i]);
  1305 + find = 1;
  1306 + break;
  1307 + }
1166 1308 }
  1309 + if (find == 0) {
  1310 + var arr0 = new Array();
  1311 + arr0.push(sto_arr[i]);
  1312 + var item = {
  1313 + cat_id: find2,
  1314 + name: find2name,
  1315 + s_arr: arr0
  1316 + };
  1317 + newarr.push(item);
  1318 + }
  1319 + } else {
  1320 + qita.push(sto_arr[i]);
1167 1321 }
1168   - if (find == 0) {
  1322 + } else {
  1323 + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
  1324 + if (find2 != 0) {
1169 1325 var arr0 = new Array();
1170 1326 arr0.push(sto_arr[i]);
1171 1327 var item = {
... ... @@ -1174,63 +1330,51 @@ Page({
1174 1330 s_arr: arr0
1175 1331 };
1176 1332 newarr.push(item);
  1333 + } else {
  1334 + qita.push(sto_arr[i]);
1177 1335 }
1178   - } else {
1179   - qita.push(sto_arr[i]);
1180   - }
1181   - } else {
1182   - //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
1183   - if (find2 != 0) {
1184   - var arr0 = new Array();
1185   - arr0.push(sto_arr[i]);
1186   - var item = {
1187   - cat_id: find2,
1188   - name: find2name,
1189   - s_arr: arr0
1190   - };
1191   - newarr.push(item);
1192   - } else {
1193   - qita.push(sto_arr[i]);
1194 1336 }
1195 1337 }
1196   - }
1197 1338  
1198   - //----安排其他的分类-----
1199   - if (qita.length > 0) {
1200   - var item = {
1201   - cat_id: -1,
1202   - name: "其他",
1203   - s_arr: qita
1204   - };
1205   - newarr.push(item);
1206   - }
1207   - th.setData({
1208   - is_show_sto_cat: 1,
1209   - all_sto: newarr
1210   - });
  1339 + //----安排其他的分类-----
  1340 + if (qita.length > 0) {
  1341 + var item = {
  1342 + cat_id: -1,
  1343 + name: "其他",
  1344 + s_arr: qita
  1345 + };
  1346 + newarr.push(item);
  1347 + }
  1348 + th.setData({
  1349 + is_show_sto_cat: 1,
  1350 + all_sto: newarr
  1351 + });
1211 1352  
  1353 + } else {
  1354 + th.setData({
  1355 + is_show_sto_cat: -1,
  1356 + only_pk: e.data.data.pageData
  1357 + });
  1358 + }
1212 1359 } else {
1213 1360 th.setData({
1214   - is_show_sto_cat: 0,
  1361 + is_show_sto_cat: -1,
1215 1362 only_pk: e.data.data.pageData
1216 1363 });
1217 1364 }
1218   - } else {
1219   - th.setData({
1220   - is_show_sto_cat: 0,
1221   - only_pk: e.data.data.pageData
1222   - });
1223 1365 }
1224   - }
1225   - });
1226   - } else {
1227   - th.setData({
1228   - is_show_sto_cat: 0,
1229   - only_pk: e.data.data.pageData
1230   - });
  1366 + });
  1367 + } else {
  1368 + th.setData({
  1369 + is_show_sto_cat: 0,
  1370 + only_pk: e.data.data.pageData
  1371 + });
  1372 + }
1231 1373 }
1232   - }
1233   - })
  1374 + })
  1375 + }, 200)
  1376 +
  1377 +
1234 1378 },
1235 1379  
1236 1380 //----------取货门店被点击的效果------
... ... @@ -1272,59 +1416,77 @@ Page({
1272 1416 },
1273 1417  
1274 1418 //评论的调用
1275   - requestComments: function() {
1276   - var e = this, th = e;
1277   - var tp = e.data.activeCategoryId3;
  1419 + requestComments_new: async function(){
  1420 + var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3;
1278 1421 var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;
1279 1422  
1280   - var req_where={
1281   - store_id: o.stoid,
1282   - pageSize: 5,
1283   - parent_id: 0,
1284   - goods_id: th.data.gid,
1285   - commenttype: tp,
1286   -
  1423 + wx.showLoading();
  1424 + var req_where = {
  1425 + store_id: o.stoid, pageSize: 5,is_show:1,
  1426 + parent_id: 0, goods_id: th.data.gid, commenttype: tp,
1287 1427 }
1288   - if(getApp().globalData.userInfo){
1289   - req_where.userId=getApp().globalData.userInfo.user_id;
  1428 + if (getApp().globalData.userInfo) {
  1429 + req_where.userId = getApp().globalData.userInfo.user_id;
1290 1430 }
1291 1431  
1292   - n.request(t, async function(ee) {
1293   - var tot = ee.data.data.total;
1294   - e.setData({
1295   - com_num: tot,get_c:1
1296   - });
  1432 + var rs_data=null;
  1433 + await getApp().request.promiseGet(t, { data: req_where}).then(res=>{
  1434 + var tot = res.data.data.total;
1297 1435 e.data.c_curr_p++;
  1436 + e.setData({
  1437 + com_num: tot, //已经有加载
  1438 + });
  1439 + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  1440 + rs_data=res.data.data.pageData;
  1441 + }else{
  1442 + th.setData({comments_no_more:1,auto:1});
  1443 + }
  1444 + })
1298 1445  
1299   - var cda = th.data.comments;
1300   - for(var ind in cda){
1301   - var ep= cda[ind];
1302   - if(ep.is_req!=1){
1303   - await getApp().request.promiseGet("/api/weshop/comment/pageComment",{
1304   - data:{store_id:o.stoid ,parent_id:ep.comment_id}
1305   - }).then(res=>{
1306   - cda[ind].is_req=1;
1307   - if(cda[ind].head_pic==''){
1308   - cda[ind].head_pic= th.data.iurl+"/miniapp/images/hui_hear_pic.png";
1309   - }
1310   - if(res.data.data.pageData && res.data.data.pageData.length>0){
1311   - cda[ind].replay_list=res.data.data.pageData;
1312   - }
1313   - })
1314   - }
  1446 + if (rs_data){
  1447 + //var cda = th.data.comments;
  1448 + var cda = rs_data,com_data=th.data.comments;
  1449 + for (var ind in cda) {
  1450 + var ep = cda[ind];
  1451 + if (cda[ind].head_pic == '') {
  1452 + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";
  1453 + }
  1454 + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {
  1455 + cda[ind].weapp_img = JSON.parse(ep.weapp_img);
  1456 + }
  1457 + if (ep.img != "" && ut.isString(ep.img)) {
  1458 + cda[ind].img = ut.unserialize(ep.img);
  1459 + }
  1460 +
  1461 + //--测量多有字的宽带,计算有多少行--
  1462 + var widh=ut.measureText(ep.content,30);
  1463 + var lines=widh/712;
  1464 + cda[ind].seeMore=false;
  1465 + if(lines>3) cda[ind].seeMore=true;
  1466 +
  1467 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  1468 + data: {store_id: o.stoid, parent_id: ep.comment_id }
  1469 + }).then(res => {
  1470 + if (res.data.data.pageData && res.data.data.pageData.length > 0) {
  1471 + cda[ind].replay_list = res.data.data.pageData;
  1472 + }
  1473 + })
1315 1474 }
1316 1475  
1317   - th.setData({
1318   - comments: cda
1319   - });
  1476 + if (!com_data) com_data = cda;
  1477 + else com_data = com_data.concat(cda);
1320 1478  
1321   - }, null,req_where);
  1479 + th.setData({ comments: com_data});
  1480 + }
  1481 + th.setData({get_c: 1});
  1482 + wx.hideLoading();
1322 1483 },
1323 1484  
1324 1485 //加载更多是靠这个函数
1325 1486 onReachBottom: function() {
1326   - if (this.data.activeCategoryId == 2)
1327   - n.canloadMore() && this.requestComments();
  1487 + if (this.data.activeCategoryId == 2){
  1488 + if(!this.data.comments_no_more) this.requestComments_new();
  1489 + }
1328 1490 },
1329 1491  
1330 1492 //--------检查是否活动,活动是否开始,或者是否结束-------
... ... @@ -1333,7 +1495,8 @@ Page({
1333 1495 th = ee;
1334 1496 if (prom_type == 3 || prom_type == 0) {
1335 1497 this.setData({
1336   - prom_type: prom_type,isshow:1,
  1498 + prom_type: prom_type,
  1499 + isshow: 1,
1337 1500 });
1338 1501 return false;
1339 1502 }
... ... @@ -1356,7 +1519,8 @@ Page({
1356 1519 success: function(t) {
1357 1520 if (t.data.code != 0) {
1358 1521 ee.setData({
1359   - prom_type: 0,isshow:1,
  1522 + prom_type: 0,
  1523 + isshow: 1,
1360 1524 });
1361 1525 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1362 1526 return false;
... ... @@ -1364,25 +1528,28 @@ Page({
1364 1528 //----已经结束-----
1365 1529 if (t.data.data.is_end == 1) {
1366 1530 ee.setData({
1367   - prom_type: 0,isshow:1,
  1531 + prom_type: 0,
  1532 + isshow: 1,
1368 1533 });
1369 1534 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1370 1535 return false;
1371 1536 }
1372 1537 //----已经过期-----
1373 1538 var now = ut.gettimestamp();
1374   - if (t.data.data.end_time < now ) {
  1539 + if (t.data.data.end_time < now) {
1375 1540 ee.setData({
1376   - prom_type: 0,isshow:1,
  1541 + prom_type: 0,
  1542 + isshow: 1,
1377 1543 });
1378 1544 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1379 1545 return false;
1380 1546 }
1381 1547  
1382 1548 /*-- 还没有开始预热的也不显示 --*/
1383   - if (t.data.data.show_time >now) {
  1549 + if (t.data.data.show_time > now) {
1384 1550 ee.setData({
1385   - prom_type: 0,isshow:1,
  1551 + prom_type: 0,
  1552 + isshow: 1,
1386 1553 });
1387 1554 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1388 1555 return false;
... ... @@ -1400,7 +1567,7 @@ Page({
1400 1567 prom_act: t.data.data,
1401 1568 prom_end_time: prom_end_time,
1402 1569 prom_start_time: prom_start_time,
1403   - isshow:1,
  1570 + isshow: 1,
1404 1571 });
1405 1572  
1406 1573  
... ... @@ -1452,7 +1619,8 @@ Page({
1452 1619 success: function(t) {
1453 1620 if (t.data.code != 0) {
1454 1621 ee.setData({
1455   - prom_type: 0,isshow:1,
  1622 + prom_type: 0,
  1623 + isshow: 1,
1456 1624 });
1457 1625 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1458 1626 return false;
... ... @@ -1460,7 +1628,8 @@ Page({
1460 1628 //----已经结束-----
1461 1629 if (t.data.data.is_end == 1) {
1462 1630 ee.setData({
1463   - prom_type: 0,isshow:1,
  1631 + prom_type: 0,
  1632 + isshow: 1,
1464 1633 });
1465 1634 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1466 1635 return false;
... ... @@ -1469,7 +1638,8 @@ Page({
1469 1638 var now = ut.gettimestamp();
1470 1639 if (t.data.data.end_time < now) {
1471 1640 ee.setData({
1472   - prom_type: 0,isshow:1,
  1641 + prom_type: 0,
  1642 + isshow: 1,
1473 1643 });
1474 1644 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1475 1645 return false;
... ... @@ -1478,7 +1648,8 @@ Page({
1478 1648 /*-- 还没有开始预热的也不显示 --*/
1479 1649 if (t.data.data.show_time > now) {
1480 1650 ee.setData({
1481   - prom_type: 0,isshow:1,
  1651 + prom_type: 0,
  1652 + isshow: 1,
1482 1653 });
1483 1654 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1484 1655 return false;
... ... @@ -1499,51 +1670,55 @@ Page({
1499 1670 th.data.buy_order = odr;
1500 1671 if (odr.pt_status == 0 && odr.order_status == 1) {
1501 1672 th.setData({
1502   - user_order_pt_state: 1
  1673 + user_order_pt_state: 1
1503 1674 });
1504 1675 }
1505 1676 if (odr.pt_status == 1 && odr.order_status == 1) {
1506   - if (odr.is_zsorder == 4){
1507   - getApp().request.promiseGet("/api/weshop/teamgroup/page/", {
1508   - data: { store_id: os.stoid, team_id: odr.pt_prom_id, listno: odr.pt_listno }
1509   - }).then(res => {
1510   - var now=ut.gettimestamp();
1511   - var tgr = res.data.data.pageData[0];
1512   - //如果团的时间已经到了
1513   - if (now >= tgr.kt_end_time){
1514   - th.update_jiti(tgr.id);
1515   - }else{
1516   - th.setData({
1517   - user_order_pt_state: 2
1518   - });
1519   - }
1520   - })
1521   -
1522   - }else{
1523   - th.setData({
1524   - user_order_pt_state: 2
1525   - });
1526   - }
1527   - }
1528   -
1529   - if (odr.pt_status == 2 && odr.is_zsorder == 4) {
  1677 + if (odr.is_zsorder == 4) {
  1678 + getApp().request.promiseGet("/api/weshop/teamgroup/page/", {
  1679 + data: {
  1680 + store_id: os.stoid,
  1681 + team_id: odr.pt_prom_id,
  1682 + listno: odr.pt_listno
  1683 + }
  1684 + }).then(res => {
  1685 + var now = ut.gettimestamp();
  1686 + var tgr = res.data.data.pageData[0];
  1687 + //如果团的时间已经到了
  1688 + if (now >= tgr.kt_end_time) {
  1689 + th.update_jiti(tgr.id);
  1690 + } else {
  1691 + th.setData({
  1692 + user_order_pt_state: 2
  1693 + });
  1694 + }
  1695 + })
  1696 +
  1697 + } else {
1530 1698 th.setData({
1531   - user_order_pt_state: 3,
  1699 + user_order_pt_state: 2
1532 1700 });
1533   - th.data.wk_order_id=odr.order_id;
  1701 + }
  1702 + }
  1703 +
  1704 + if (odr.pt_status == 2 && odr.is_zsorder == 4) {
  1705 + th.setData({
  1706 + user_order_pt_state: 3,
  1707 + });
  1708 + th.data.wk_order_id = odr.order_id;
1534 1709 }
1535 1710 }
1536 1711 },
1537 1712 });
1538 1713  
1539 1714 //----------查看阶梯团------------
1540   - if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined){
1541   - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);
1542   - var max_num=0;
1543   - t.data.data.ct_rylist.forEach(function (val,ind) {
1544   - if(val.rynum>max_num) max_num=val.rynum;
1545   - })
1546   - t.data.data.max_ct_num=max_num;
  1715 + if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {
  1716 + t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);
  1717 + var max_num = 0;
  1718 + t.data.data.ct_rylist.forEach(function(val, ind) {
  1719 + if (val.rynum > max_num) max_num = val.rynum;
  1720 + })
  1721 + t.data.data.max_ct_num = max_num;
1547 1722 }
1548 1723  
1549 1724 var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
... ... @@ -1556,7 +1731,7 @@ Page({
1556 1731 prom_act: t.data.data,
1557 1732 prom_end_time: prom_end_time,
1558 1733 prom_start_time: prom_start_time,
1559   - isshow:1,
  1734 + isshow: 1,
1560 1735 });
1561 1736  
1562 1737 var newTime = now;
... ... @@ -1588,40 +1763,51 @@ Page({
1588 1763 },
1589 1764  
1590 1765 //--获取有多少人在开团--
1591   - async get_team_group(prom_id){
1592   - var teamgroup=[],th=this,grounp_tatal=0;
1593   - //如果活动是开团不是商家团
1594   - if(this.data.prom_act.kttype>1) {
1595   - //获取活动从表信息team_id
1596   - await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
  1766 + async get_team_group(prom_id) {
  1767 + var teamgroup = [],
  1768 + th = this,
  1769 + grounp_tatal = 0;
  1770 + //如果活动是开团不是商家团
  1771 + if (this.data.prom_act.kttype > 1) {
  1772 + //获取活动从表信息team_id
  1773 + await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
  1774 + data: {
  1775 + store_id: os.stoid,
  1776 + pageSize: 3,
  1777 + page: 1,
  1778 + state: 2,
  1779 + team_id: prom_id
  1780 + }
  1781 + }).then(res => {
  1782 + teamgroup = res.data.data.pageData;
  1783 + grounp_tatal = res.data.data.total;
  1784 + })
  1785 + //获取订单的总数这个接口不能用
  1786 + for (i = 0; i < teamgroup.length; i++) {
  1787 + await getApp().request.promiseGet("/api/weshop/order/page", {
1597 1788 data: {
1598   - store_id: os.stoid, pageSize: 3, page: 1,
1599   - state: 2,
1600   - team_id: prom_id
  1789 + store_id: os.stoid,
  1790 + pt_status: 1,
  1791 + pt_listno: teamgroup[i].listno
1601 1792 }
1602 1793 }).then(res => {
1603   - teamgroup = res.data.data.pageData;
1604   - grounp_tatal = res.data.data.total;
  1794 + var order = res.data.data.pageData;
  1795 + teamgroup[i].open_num = order.length;
1605 1796 })
1606   - //获取订单的总数这个接口不能用
1607   - for (i = 0; i < teamgroup.length; i++) {
1608   - await getApp().request.promiseGet("/api/weshop/order/page", {
1609   - data: { store_id: os.stoid, pt_status: 1, pt_listno: teamgroup[i].listno }
1610   - }).then(res => {
1611   - var order = res.data.data.pageData;
1612   - teamgroup[i].open_num = order.length;
1613   - })
1614   - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {
1615   - var user = res.data.data;
1616   - teamgroup[i].user = user;
1617   - })
1618   - }
  1797 + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {
  1798 + var user = res.data.data;
  1799 + teamgroup[i].user = user;
  1800 + })
  1801 + }
1619 1802  
1620   - if (teamgroup.length > 0) {
1621   - th.setData({ teamgroup: teamgroup, grounp_tatal: grounp_tatal });
1622   - th.countDown2();
1623   - }
  1803 + if (teamgroup.length > 0) {
  1804 + th.setData({
  1805 + teamgroup: teamgroup,
  1806 + grounp_tatal: grounp_tatal
  1807 + });
  1808 + th.countDown2();
1624 1809 }
  1810 + }
1625 1811 },
1626 1812  
1627 1813 //---小于10的格式化函数----
... ... @@ -1631,7 +1817,7 @@ Page({
1631 1817  
1632 1818 //----倒计时函数-----
1633 1819 countDown(time, prom_st) {
1634   - if(!this.data.is_timer) return false;
  1820 + if (!this.data.is_timer) return false;
1635 1821 var th = this;
1636 1822 // 获取当前时间,同时得到活动结束时间数组
1637 1823 var endTime = time;
... ... @@ -1736,8 +1922,8 @@ Page({
1736 1922 if (tt.data.code == 0) {
1737 1923 map.set(gd.goods_id, g_buy_num);
1738 1924 th.setData({
1739   - g_buy_num: map,
1740   - prom_buy_num: tt.data.data.goodsbuynum,
  1925 + g_buy_num: map,
  1926 + prom_buy_num: tt.data.data.goodsbuynum,
1741 1927 });
1742 1928 "function" == typeof func && func();
1743 1929 }
... ... @@ -1778,10 +1964,17 @@ Page({
1778 1964  
1779 1965 //--点击弹起拼单--
1780 1966 openSpecModel_pt: function(e) {
  1967 +
  1968 +
  1969 + this.setData({ open_ind_store: 4});//拼团直接给4
  1970 +
  1971 +
1781 1972 //--先判断会员状态--
1782   - var user_info=getApp().globalData.userInfo;
1783   - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){
1784   - wx.navigateTo({ url: '/pages/getphone/getphone', })
  1973 + var user_info = getApp().globalData.userInfo;
  1974 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1975 + wx.navigateTo({
  1976 + url: '/pages/getphone/getphone',
  1977 + })
1785 1978 return false;
1786 1979 }
1787 1980  
... ... @@ -1814,7 +2007,7 @@ Page({
1814 2007 pageSize: 1,
1815 2008 page: 1
1816 2009 },
1817   - success: function (e) {
  2010 + success: function(e) {
1818 2011 //--跳转到已经购买的情况--
1819 2012 if (e.data.data.pageData.length > 0) {
1820 2013 var odr = e.data.data.pageData[0];
... ... @@ -1823,12 +2016,12 @@ Page({
1823 2016 wx.showModal({
1824 2017 title: "您已经购买了该商品待支付中",
1825 2018 success: function(a) {
1826   - if(a.confirm){
1827   - wx.navigateTo({
1828   - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
1829   - });
1830   - }
1831   - }
  2019 + if (a.confirm) {
  2020 + wx.navigateTo({
  2021 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  2022 + });
  2023 + }
  2024 + }
1832 2025 });
1833 2026 } else if (odr.pt_status == 1 && odr.order_status == 1) {
1834 2027 wx.navigateTo({
... ... @@ -1841,8 +2034,7 @@ Page({
1841 2034 });
1842 2035 }
1843 2036  
1844   - }
1845   - else{
  2037 + } else {
1846 2038 th.setData({
1847 2039 is_normal: ind,
1848 2040 openSpecModal_pt: 1
... ... @@ -1855,30 +2047,33 @@ Page({
1855 2047  
1856 2048 //-----------------拼单生成方法---------------------
1857 2049 addCart_pt: function() {
1858   - var th=this;
1859   - if(this.data.is_normal==0){
1860   - //看一下有没有起购数,如果有起购数,要计算起购数
1861   - var qnum=parseFloat(th.data.prom_act.minbuynum);
1862   - if(qnum>0 && th.data.goodsInputNum<qnum ){
1863   - getApp().confirmBox("拼团商品至少要买"+qnum+"件!");
1864   - return false;
1865   - }
  2050 + var th = this;
  2051 + if (this.data.is_normal == 0) {
  2052 + //看一下有没有起购数,如果有起购数,要计算起购数
  2053 + var qnum = parseFloat(th.data.prom_act.minbuynum);
  2054 + if (qnum > 0 && th.data.goodsInputNum < qnum) {
  2055 + getApp().confirmBox("拼团商品至少要买" + qnum + "件!");
  2056 + return false;
  2057 + }
1866 2058  
1867   - th.addcart_pt_func();
1868   - }else{
  2059 + th.addcart_pt_func();
  2060 + } else {
1869 2061 th.addcart_pt_func();
1870 2062 }
1871 2063 },
1872 2064  
1873   - addcart_pt_func:function(){
  2065 + addcart_pt_func: function() {
1874 2066 if (oo.user_id == null) {
1875   - s.my_warnning("还未登录!",0,this);return;
  2067 + s.my_warnning("还未登录!", 0, this);
  2068 + return;
1876 2069 }
1877   - var e = this, th = e,o = this.data.sele_g;
1878   - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th);
  2070 + var e = this,
  2071 + th = e,
  2072 + o = this.data.sele_g;
  2073 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
1879 2074  
1880 2075 //----------添加到购物车时,要判断限购数量,--------
1881   - e.get_buy_num(o,async function(ee) {
  2076 + e.get_buy_num(o, async function(ee) {
1882 2077  
1883 2078 //---判断商品是否超出限购---
1884 2079 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
... ... @@ -1901,28 +2096,29 @@ Page({
1901 2096 }
1902 2097 }
1903 2098  
1904   - var redis_num=0
1905   - //-------判断活动是否抢光---------
1906   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/"+th.data.sele_g.prom_id , {
1907   - 1: 1
1908   - }).then(res => {
1909   - redis_num=res.data.data;
1910   - })
  2099 + var redis_num = 0
  2100 + //-------判断活动是否抢光---------
  2101 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {
  2102 + 1: 1
  2103 + }).then(res => {
  2104 + redis_num = res.data.data;
  2105 + })
1911 2106  
1912   - if(th.data.goodsInputNum>redis_num){
1913   - wx.showModal({
1914   - title: '提示',content: '超出商品活动库存'
1915   - });
1916   - return false;
1917   - }
  2107 + if (th.data.goodsInputNum > redis_num) {
  2108 + wx.showModal({
  2109 + title: '提示',
  2110 + content: '超出商品活动库存'
  2111 + });
  2112 + return false;
  2113 + }
1918 2114  
1919   - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th);
1920   - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th);
  2115 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  2116 + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th);
1921 2117 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
1922 2118 this.setData({
1923 2119 sto_sele_name: ""
1924 2120 });
1925   - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th);
  2121 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
1926 2122 //--------------此时操作的数据------------
1927 2123 var newd = {
1928 2124 goods_id: o.goods_id,
... ... @@ -1947,8 +2143,8 @@ Page({
1947 2143 if (newd.kt_type > 1) {
1948 2144 newd.is_pt_tz = 1; //开团类型
1949 2145 }
1950   - if (newd.kt_type == 3 && th.data.is_normal!=1){
1951   - th.data.sto_sele_distr=1;
  2146 + if (newd.kt_type == 3 && th.data.is_normal != 1) {
  2147 + th.data.sto_sele_distr = 1;
1952 2148 }
1953 2149  
1954 2150 } else if (th.data.prom_type == 3) {
... ... @@ -1973,14 +2169,14 @@ Page({
1973 2169  
1974 2170 //-------跳转pt商品-------
1975 2171 go_to_nopay: function() {
1976   - var th=this;
  2172 + var th = this;
1977 2173 wx.navigateTo({
1978 2174 url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id,
1979 2175 });
1980 2176 },
1981 2177 //-------跳转pt teamshow-------
1982 2178 go_to_team_show: function() {
1983   - var th=this;
  2179 + var th = this;
1984 2180 wx.navigateTo({
1985 2181 url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn,
1986 2182 });
... ... @@ -1988,7 +2184,7 @@ Page({
1988 2184  
1989 2185 //---拼团倒计时---
1990 2186 countDown2() {
1991   - if(!this.data.is_timer) return false;
  2187 + if (!this.data.is_timer) return false;
1992 2188 var th = this;
1993 2189 // 获取当前时间,同时得到活动结束时间数组
1994 2190 var newTime = ut.gettimestamp();
... ... @@ -2014,7 +2210,10 @@ Page({
2014 2210 } else {
2015 2211 //活动已结束,全部设置为'00'
2016 2212 obj = {
2017   - day: '00',hou: '00',min: '00', sec: '00'
  2213 + day: '00',
  2214 + hou: '00',
  2215 + min: '00',
  2216 + sec: '00'
2018 2217 }
2019 2218 }
2020 2219 var txt = "timer[" + j + "]";
... ... @@ -2025,11 +2224,11 @@ Page({
2025 2224 setTimeout(th.countDown2, 1000);
2026 2225 },
2027 2226 //跳转参加团
2028   - go_cj_team:function (e) {
2029   - var ind=e.currentTarget.dataset.ind;
2030   - var item=this.data.teamgroup[ind];
2031   - var id=item.id;
2032   - var th=this;
  2227 + go_cj_team: function(e) {
  2228 + var ind = e.currentTarget.dataset.ind;
  2229 + var item = this.data.teamgroup[ind];
  2230 + var id = item.id;
  2231 + var th = this;
2033 2232  
2034 2233 getApp().request.get("/api/weshop/order/page", {
2035 2234 data: {
... ... @@ -2040,205 +2239,231 @@ Page({
2040 2239 page: 1
2041 2240 },
2042 2241 success: function(e) {
2043   - if (e.data.code != 0) {
2044   - getApp().my_warnning("读取订单失败",0,th);
2045   - return fasle;
2046   - }
2047   - //--跳转到已经购买的情况--
2048   - if ( e.data.data.pageData.length > 0) {
2049   - var odr = e.data.data.pageData[0];
2050   - //还未支付
2051   - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0) ) {
2052   - wx.showModal({
2053   - title: "您已经购买了该商品待支付中",
2054   - success: function(a) {
2055   - if(a.confirm){
2056   - wx.navigateTo({
2057   - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
2058   - });
2059   - }
2060   - }
2061   - });
2062   - }else if (odr.pt_status == 1 && odr.order_status == 1){
2063   - wx.navigateTo({
2064   - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
2065   - });
2066   - }else{
2067   - wx.navigateTo({
2068   - url: "/pages/team/team_show/team_show?tg_id="+id,
2069   - });
2070   - }
2071   - }
2072   - //--跳转到参团--
2073   - else{
  2242 + if (e.data.code != 0) {
  2243 + getApp().my_warnning("读取订单失败", 0, th);
  2244 + return fasle;
  2245 + }
  2246 + //--跳转到已经购买的情况--
  2247 + if (e.data.data.pageData.length > 0) {
  2248 + var odr = e.data.data.pageData[0];
  2249 + //还未支付
  2250 + if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  2251 + wx.showModal({
  2252 + title: "您已经购买了该商品待支付中",
  2253 + success: function(a) {
  2254 + if (a.confirm) {
  2255 + wx.navigateTo({
  2256 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  2257 + });
  2258 + }
  2259 + }
  2260 + });
  2261 + } else if (odr.pt_status == 1 && odr.order_status == 1) {
2074 2262 wx.navigateTo({
2075   - url: "/pages/team/team_show/team_show?tg_id="+id,
  2263 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  2264 + });
  2265 + } else {
  2266 + wx.navigateTo({
  2267 + url: "/pages/team/team_show/team_show?tg_id=" + id,
2076 2268 });
2077 2269 }
  2270 + }
  2271 + //--跳转到参团--
  2272 + else {
  2273 + wx.navigateTo({
  2274 + url: "/pages/team/team_show/team_show?tg_id=" + id,
  2275 + });
  2276 + }
2078 2277 }
2079 2278 })
2080 2279  
2081 2280 },
2082 2281  
2083   - //跳到团更多
2084   - go_t_more:function(){
2085   - var team_id=this.data.prom_id;
2086   - wx.navigateTo({
2087   - url: "/pages/team/team_more/team_more?team_id="+team_id,
2088   - });
2089   - },
  2282 + //跳到团更多
  2283 + go_t_more: function() {
  2284 + var team_id = this.data.prom_id;
  2285 + wx.navigateTo({
  2286 + url: "/pages/team/team_more/team_more?team_id=" + team_id,
  2287 + });
  2288 + },
2090 2289  
2091   - //--点赞功能--
2092   - click_zan:function (e) {
2093   - var com_id=e.currentTarget.dataset.com_id;
2094   - var item_id=e.currentTarget.dataset.item_id;
2095   - var app=getApp(),th=this;
  2290 + //--点赞功能--
  2291 + click_zan: function(e) {
  2292 + var com_id = e.currentTarget.dataset.com_id;
  2293 + var item_id = e.currentTarget.dataset.item_id;
  2294 + var app = getApp(),
  2295 + th = this;
2096 2296  
2097   - if(app.globalData.userInfo==null || app.globalData.userInfo==undefined ){
2098   - app.confirmBox("您还未登录");
2099   - return false;
2100   - }
  2297 + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {
  2298 + app.confirmBox("您还未登录");
  2299 + return false;
  2300 + }
2101 2301  
2102   - var iszan=th.data.comments[item_id].userZanNum;
2103   - if(this.data.iszaning) return false;
2104   - this.data.iszaning=1;
  2302 + var iszan = th.data.comments[item_id].userZanNum;
  2303 + if (this.data.iszaning) return false;
  2304 + this.data.iszaning = 1;
2105 2305  
2106 2306  
2107   - app.request.post("/api/weshop/commentZan/save",{
2108   - data:{store_id:o.stoid,user_id:app.globalData.user_id,goods_id:th.data.gid,comment_id:com_id},
2109   - success:function (ee) {
  2307 + app.request.post("/api/weshop/commentZan/save", {
  2308 + data: {
  2309 + store_id: o.stoid,
  2310 + user_id: app.globalData.user_id,
  2311 + goods_id: th.data.gid,
  2312 + comment_id: com_id
  2313 + },
  2314 + success: function(ee) {
2110 2315  
2111   - if (ee.data.code == "-1") {
2112   - app.my_warnning("不能给自己点赞", 0, th);
2113   - th.data.iszaning=0;
2114   - return;
2115   - }
  2316 + if (ee.data.code == "-1") {
  2317 + app.my_warnning("不能给自己点赞", 0, th);
  2318 + th.data.iszaning = 0;
  2319 + return;
  2320 + }
2116 2321  
2117   - if(ee.data.code==0 && iszan!=1){
2118   - var num=th.data.comments[item_id].zan_num; num++;
2119   - var text="comments["+item_id+"].zan_num";
2120   - var text1="comments["+item_id+"].userZanNum";
2121   - var _errObj = {};
2122   - _errObj[text]=num;
2123   - _errObj[text1]=1;
2124   - th.setData(_errObj);
2125   -
2126   - }else{
2127   - var num=th.data.comments[item_id].zan_num; num--;
2128   - var text="comments["+item_id+"].zan_num";
2129   - var text1="comments["+item_id+"].userZanNum";
2130   - var _errObj = {};
2131   - _errObj[text]=num;
2132   - _errObj[text1]=0;
2133   - th.setData(_errObj);
2134   - }
  2322 + if (ee.data.code == 0 && iszan != 1) {
  2323 + var num = th.data.comments[item_id].zan_num;
  2324 + num++;
  2325 + var text = "comments[" + item_id + "].zan_num";
  2326 + var text1 = "comments[" + item_id + "].userZanNum";
  2327 + var _errObj = {};
  2328 + _errObj[text] = num;
  2329 + _errObj[text1] = 1;
  2330 + th.setData(_errObj);
2135 2331  
2136   - setTimeout(function(){
2137   - th.data.iszaning = 0;
2138   - },500)
2139   -
2140   - }
2141   - })
2142   - },
  2332 + } else {
  2333 + var num = th.data.comments[item_id].zan_num;
  2334 + num--;
  2335 + var text = "comments[" + item_id + "].zan_num";
  2336 + var text1 = "comments[" + item_id + "].userZanNum";
  2337 + var _errObj = {};
  2338 + _errObj[text] = num;
  2339 + _errObj[text1] = 0;
  2340 + th.setData(_errObj);
  2341 + }
  2342 +
  2343 + setTimeout(function() {
  2344 + th.data.iszaning = 0;
  2345 + }, 500)
  2346 +
  2347 + }
  2348 + })
  2349 + },
2143 2350  
2144 2351 /*----券的开关---*/
2145   - switchCoupon:async function(event){
  2352 + switchCoupon: async function(event) {
2146 2353 var coupon = event.currentTarget.dataset.coupon;
2147   - var app=getApp();
2148   - var url="/api/weshop/prom/coupon/pageCouponList";
2149   - var quan_list=this.data.quan_list;
2150   - var th=this;
  2354 + var app = getApp();
  2355 + var url = "/api/weshop/prom/coupon/pageCouponList";
  2356 + var quan_list = this.data.quan_list;
  2357 + var th = this;
2151 2358  
2152 2359 //当开启,且列表为空的情况下要
2153   - if(!quan_list && coupon=="1") {
2154   - wx.showLoading();
2155   - await app.request.promiseGet(url, {
2156   - data: {
2157   - store_id: os.stoid,
2158   - type: 1,
2159   - pageSize: 100,
2160   - page: 1,
2161   - user_id:app.globalData.user_id
2162   - }
2163   - }).then(res => {
2164   - wx.hideLoading();
2165   - quan_list = res.data.data.pageData;
2166   - })
  2360 + if (!quan_list && coupon == "1") {
  2361 + wx.showLoading();
  2362 + await app.request.promiseGet(url, {
  2363 + data: {
  2364 + store_id: os.stoid,
  2365 + type: 1,
  2366 + pageSize: 100,
  2367 + page: 1,
  2368 + user_id: app.globalData.user_id
  2369 + }
  2370 + }).then(res => {
  2371 + wx.hideLoading();
  2372 + quan_list = res.data.data.pageData;
  2373 + })
2167 2374  
2168   - if(quan_list){
2169   - for(var ind in quan_list){
2170   - var ep=quan_list[ind];
2171   - var start=ut.formatTime(ep.use_start_time,"yyyy-MM-dd");
2172   - var end=ut.formatTime(ep.use_end_time,"yyyy-MM-dd");
2173   - start=start.replace("00:00:00","");
2174   - end=end.replace("00:00:00","");
2175   - quan_list[ind].start=start;
2176   - quan_list[ind].end=end;
2177   - }
  2375 + if (quan_list) {
  2376 + for (var ind in quan_list) {
  2377 + var ep = quan_list[ind];
  2378 + var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");
  2379 + var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");
  2380 + start = start.replace("00:00:00", "");
  2381 + end = end.replace("00:00:00", "");
  2382 + quan_list[ind].start = start;
  2383 + quan_list[ind].end = end;
2178 2384 }
  2385 + }
2179 2386  
2180   - th.setData({coupon: coupon, quan_list: quan_list});
2181   - }else{
2182   - th.setData({coupon: coupon});
  2387 + th.setData({
  2388 + coupon: coupon,
  2389 + quan_list: quan_list
  2390 + });
  2391 + } else {
  2392 + th.setData({
  2393 + coupon: coupon
  2394 + });
2183 2395 }
2184 2396 },
2185 2397  
2186 2398 //--查看评价--
2187   - look_pj:function () {
2188   - this.tabComment(); this.doScrollTop();
  2399 + look_pj: function() {
  2400 + this.tabComment();
  2401 + this.doScrollTop();
2189 2402 },
2190 2403  
2191 2404 //-----领取券-----
2192   - get_quan:function (e) {
2193   - var cid=e.currentTarget.dataset.cid;
2194   - var index=e.currentTarget.dataset.ind;
2195   - var item=this.data.quan_list[index];
2196   -
  2405 + get_quan: function(e) {
  2406 + var cid = e.currentTarget.dataset.cid;
  2407 + var index = e.currentTarget.dataset.ind;
  2408 + var item = this.data.quan_list[index];
  2409 +
2197 2410 //如果券还在领取中,不能再点
2198   - if (item.linging==1){
  2411 + if (item.linging == 1) {
2199 2412 getApp().my_warnning('领取中..', 0, this);
2200 2413 return false;
2201 2414 }
2202 2415  
2203 2416 //如果领取的次数到了
2204   - if(item.everyone_num>0 && item.lqnum>=item.everyone_num){
2205   - getApp().my_warnning('领取失败,您已领完该券',0,this);
  2417 + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {
  2418 + getApp().my_warnning('领取失败,您已领完该券', 0, this);
2206 2419 return false;
2207 2420 }
2208 2421  
2209   - var lq_num=item.lqnum;
2210   -
2211   - var pdata={'uid':oo.user_id,'cid':cid,'store_id':os.stoid,'type':5};
2212   - var app=getApp(),th=this;
2213   - app.request.post("/api/weshop/couponList/saveCouponList",{
2214   - data:pdata,
2215   - success:function (res) {
2216   - if(res.data.code==0){
2217   - app.my_warnning("领取成功",1,th);
2218   - lq_num++;
2219   - var text="quan_list["+index+"].lqnum";
2220   - var text2 = "quan_list[" + index + "].linging";
2221   - var obj = {}; obj[text] = lq_num; obj[text2] = 0;
2222   - th.setData(obj);
2223   - }else{
2224   - app.confirmBox(res.data.msg);
2225   - var text2 = "quan_list[" + index + "].linging";
2226   - var obj = {}; obj[text2] = 0;
2227   - th.setData(obj);
2228   - }
  2422 + var lq_num = item.lqnum;
  2423 +
  2424 + var pdata = {
  2425 + 'uid': oo.user_id,
  2426 + 'cid': cid,
  2427 + 'store_id': os.stoid,
  2428 + 'type': 5
  2429 + };
  2430 + var app = getApp(),
  2431 + th = this;
  2432 + app.request.post("/api/weshop/couponList/saveCouponList", {
  2433 + data: pdata,
  2434 + success: function(res) {
  2435 + if (res.data.code == 0) {
  2436 + app.my_warnning("领取成功", 1, th);
  2437 + lq_num++;
  2438 + var text = "quan_list[" + index + "].lqnum";
  2439 + var text2 = "quan_list[" + index + "].linging";
  2440 + var obj = {};
  2441 + obj[text] = lq_num;
  2442 + obj[text2] = 0;
  2443 + th.setData(obj);
  2444 + } else {
  2445 + app.confirmBox(res.data.msg);
  2446 + var text2 = "quan_list[" + index + "].linging";
  2447 + var obj = {};
  2448 + obj[text2] = 0;
  2449 + th.setData(obj);
2229 2450 }
  2451 + }
2230 2452 })
2231 2453 },
2232 2454  
2233 2455 //--定义的保存图片方法,分享团---
2234   - saveImageToPhotosAlbum: function () {
  2456 + saveImageToPhotosAlbum: function() {
2235 2457 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
2236 2458 var type = this.data.prom_type;
2237 2459 if (type == 6) type = 2;
2238 2460 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
2239 2461  
2240   - wx.showLoading({ title: '生成中...', })
2241   - var that = this, th = that;
  2462 + wx.showLoading({
  2463 + title: '生成中...',
  2464 + })
  2465 + var that = this,
  2466 + th = that;
2242 2467 //设置画板显示,才能开始绘图
2243 2468 that.setData({
2244 2469 canvasHidden: false
... ... @@ -2255,9 +2480,9 @@ Page({
2255 2480 //读取文件成功则OK--
2256 2481 wx.getImageInfo({
2257 2482 src: path3,
2258   - success: function (res) {
  2483 + success: function(res) {
2259 2484 //回调写法
2260   - th.get_head_temp(th.get_goods_temp, function () {
  2485 + th.get_head_temp(th.get_goods_temp, function() {
2261 2486 var vpath = res.path;
2262 2487 var context = wx.createCanvasContext('share');
2263 2488 //先画背景
... ... @@ -2272,14 +2497,14 @@ Page({
2272 2497 var tj_path = "../../../images/share/q_tj.png";
2273 2498 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
2274 2499 context.setFontSize(16 * unit)
2275   - context.setLineJoin('round'); //交点设置成圆角
  2500 + context.setLineJoin('round'); //交点设置成圆角
2276 2501 context.setFillStyle("white")
2277 2502 context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
2278 2503  
2279 2504 //---产品名称---
2280 2505 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
2281 2506 console.log("ssssssss", th.data.data.goods_name);
2282   -
  2507 +
2283 2508 context.setFillStyle("black");
2284 2509 context.setFontSize(21.3 * unit)
2285 2510 th.draw_Text(context, th.data.data.goods_name,
... ... @@ -2308,7 +2533,7 @@ Page({
2308 2533 context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
2309 2534 //-------大图后面就不一样了-----------
2310 2535 switch (type) {
2311   - case 0: //普通商品的展示
  2536 + case 0: //普通商品的展示
2312 2537 //中间的几个字
2313 2538 var g_path = "../../../images/share/s_gou.png";
2314 2539 context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
... ... @@ -2338,7 +2563,7 @@ Page({
2338 2563 //---二维吗图---
2339 2564 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
2340 2565 break;
2341   - case 1: //秒杀商品的展示
  2566 + case 1: //秒杀商品的展示
2342 2567 //---画线---
2343 2568 context.setLineWidth(1 * unit)
2344 2569 context.moveTo(32 * unit, 670 * unit)
... ... @@ -2346,7 +2571,7 @@ Page({
2346 2571 context.stroke();
2347 2572  
2348 2573 //画秒杀的图片
2349   - var miaos_path='../../../images/share/miao_share.png';
  2574 + var miaos_path = '../../../images/share/miao_share.png';
2350 2575 context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
2351 2576  
2352 2577 //---文字---
... ... @@ -2358,7 +2583,7 @@ Page({
2358 2583 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
2359 2584 break;
2360 2585  
2361   - case 2://会员团和商家团的展示
  2586 + case 2: //会员团和商家团的展示
2362 2587 //---画线---
2363 2588 context.setLineWidth(1 * unit)
2364 2589 context.moveTo(32 * unit, 670 * unit)
... ... @@ -2393,7 +2618,7 @@ Page({
2393 2618 //---二维吗图---
2394 2619 context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
2395 2620 break
2396   - case 3://阶梯团的展示
  2621 + case 3: //阶梯团的展示
2397 2622 //---画线---
2398 2623 context.setLineWidth(1 * unit)
2399 2624 context.moveTo(32 * unit, 670 * unit)
... ... @@ -2448,35 +2673,37 @@ Page({
2448 2673 context.restore();
2449 2674  
2450 2675 //把画板内容绘制成图片,并回调 画板图片路径
2451   - context.draw(false, function () {
2452   - setTimeout(function () {
2453   - wx.canvasToTempFilePath({
2454   - x: 0, y: 0,
2455   - width: 750,
2456   - height: 1217,
2457   - destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
2458   - destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
2459   - canvasId: 'share',
2460   - success: function (res) {
2461   - that.setData({
2462   - shareImgPath: res.tempFilePath, canvasHidden: true
2463   - })
2464   - if (!res.tempFilePath) {
2465   - wx.showModal({
2466   - title: '提示',
2467   - content: '图片绘制中,请稍后重试',
2468   - showCancel: false
2469   - })
2470   - return false;
2471   - }
2472   - wx.previewImage({
2473   - //将图片预览出来
2474   - urls: [that.data.shareImgPath]
2475   - });
2476   - wx.hideLoading();
2477   - }
2478   - })
2479   - },500)
  2676 + context.draw(false, function() {
  2677 + setTimeout(function() {
  2678 + wx.canvasToTempFilePath({
  2679 + x: 0,
  2680 + y: 0,
  2681 + width: 750,
  2682 + height: 1217,
  2683 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  2684 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  2685 + canvasId: 'share',
  2686 + success: function(res) {
  2687 + that.setData({
  2688 + shareImgPath: res.tempFilePath,
  2689 + canvasHidden: true
  2690 + })
  2691 + if (!res.tempFilePath) {
  2692 + wx.showModal({
  2693 + title: '提示',
  2694 + content: '图片绘制中,请稍后重试',
  2695 + showCancel: false
  2696 + })
  2697 + return false;
  2698 + }
  2699 + wx.previewImage({
  2700 + //将图片预览出来
  2701 + urls: [that.data.shareImgPath]
  2702 + });
  2703 + wx.hideLoading();
  2704 + }
  2705 + })
  2706 + }, 500)
2480 2707  
2481 2708 });
2482 2709 });
... ... @@ -2486,21 +2713,21 @@ Page({
2486 2713  
2487 2714  
2488 2715 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
2489   - draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth,unit) {
  2716 + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
2490 2717 var lineWidth = 0;
2491 2718 var lastSubStrIndex = 0; //每次开始截取的字符串的索引
2492   - var han=0;
  2719 + var han = 0;
2493 2720 for (let i = 0; i < str.length; i++) {
2494   - if(han==2) return;
  2721 + if (han == 2) return;
2495 2722 //lineWidth += ctx.measureText(str[i]).width;
2496 2723 lineWidth += ut.measureText(str[i], 21.3 * unit);
2497 2724 if (lineWidth > canvasWidth) {
2498 2725 han++;
2499   -
2500   - if (han==2)
2501   - ctx.fillText(str.substring(lastSubStrIndex, i)+'...', leftWidth, initHeight); //绘制截取部分
  2726 +
  2727 + if (han == 2)
  2728 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
2502 2729 else
2503   - ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
  2730 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
2504 2731  
2505 2732 initHeight += 22; //22为字体的高度
2506 2733 lineWidth = 0;
... ... @@ -2515,15 +2742,17 @@ Page({
2515 2742  
2516 2743 // ----视频图片----
2517 2744 // 图片计数器
2518   - swiperChange: function (e) {
  2745 + swiperChange: function(e) {
2519 2746 var that = this;
2520   - if (e.detail.current>0){
  2747 + if (e.detail.current > 0) {
2521 2748 that.setData({
2522   - hiddenn:1, videopicture:1,
  2749 + hiddenn: 1,
  2750 + videopicture: 1,
2523 2751 })
2524   - }else{
  2752 + } else {
2525 2753 that.setData({
2526   - hiddenn:0,videopicture:0,
  2754 + hiddenn: 0,
  2755 + videopicture: 0,
2527 2756 })
2528 2757 }
2529 2758 if (e.detail.source == 'touch') {
... ... @@ -2534,18 +2763,24 @@ Page({
2534 2763 },
2535 2764  
2536 2765 /*---视频相关--*/
2537   - videopicture: function (e) {
  2766 + videopicture: function(e) {
2538 2767 var vipi = e.currentTarget.dataset.vipi;
2539   - this.setData({ videopicture: vipi, swiperCurrent:vipi, noon: 0,current:1 });
  2768 + this.setData({
  2769 + videopicture: vipi,
  2770 + swiperCurrent: vipi,
  2771 + noon: 0,
  2772 + current: 1
  2773 + });
2540 2774 },
2541 2775  
2542   - videoPlay: function (e) {
  2776 + videoPlay: function(e) {
2543 2777 var _index = e.currentTarget.id
2544 2778 this.setData({
2545   - _index: _index, noon: 1
  2779 + _index: _index,
  2780 + noon: 1
2546 2781 })
2547 2782  
2548   - setTimeout(function () {
  2783 + setTimeout(function() {
2549 2784 //将点击视频进行播放
2550 2785 var videoContext = wx.createVideoContext(_index)
2551 2786 videoContext.play();
... ... @@ -2554,46 +2789,59 @@ Page({
2554 2789  
2555 2790  
2556 2791 //--加载更多商品--
2557   - requestRecommend: function () {
2558   - var e = this, t = '/api/weshop/goods/page?page=1';
2559   - var th_recommend_list=e.data.recommend_list;
2560   - getApp().request.get(t,{
2561   - data: { is_mainshow: 1, isonsale: 1, is_recommend:1, is_on_sale: 1, store_id: os.stoid, pageSize: 6 },
2562   - success:function (ee) {
2563   - var recommend_list=ee.data.data.pageData;
2564   - if(recommend_list && recommend_list.length>0){
2565   - var dd=[...th_recommend_list,...recommend_list];
2566   - e.setData({recommend_list,dd});
2567   - e.data.currentPage++;
2568   - }else{
2569   - e.setData({nomore:1});
  2792 + requestRecommend: function() {
  2793 + var e = this,
  2794 + t = '/api/weshop/goods/page?page=1';
  2795 + var th_recommend_list = e.data.recommend_list;
  2796 + getApp().request.get(t, {
  2797 + data: {
  2798 + is_mainshow: 1,
  2799 + isonsale: 1,
  2800 + is_recommend: 1,
  2801 + is_on_sale: 1,
  2802 + store_id: os.stoid,
  2803 + pageSize: 6
  2804 + },
  2805 + success: function(ee) {
  2806 + var recommend_list = ee.data.data.pageData;
  2807 + if (recommend_list && recommend_list.length > 0) {
  2808 + var dd = [...th_recommend_list, ...recommend_list];
  2809 + e.setData({
  2810 + recommend_list,
  2811 + dd
  2812 + });
  2813 + e.data.currentPage++;
  2814 + } else {
  2815 + e.setData({
  2816 + nomore: 1
  2817 + });
2570 2818 }
2571 2819 }
2572 2820 })
2573 2821 },
2574 2822  
2575 2823 //--获取头像的本地缓存,回调写法--
2576   - get_head_temp:function (tt,func) {
2577   - var ee=this;
2578   - if(ee.data.share_head){
  2824 + get_head_temp: function(tt, func) {
  2825 + var ee = this;
  2826 + if (ee.data.share_head) {
2579 2827 tt(func);
2580 2828 return false;
2581 2829 }
2582 2830 //---获取分享图片的本地地址,头像和商品图片----
2583 2831 var path2 = getApp().globalData.userInfo.head_pic;
2584   - if(path2==""){
2585   - ee.data.share_head ="../../../images/share/hui_hear_pic.png";
  2832 + if (path2 == "") {
  2833 + ee.data.share_head = "../../../images/share/hui_hear_pic.png";
2586 2834 tt(func);
2587   - }else {
2588   - path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn");
  2835 + } else {
  2836 + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
2589 2837 wx.getImageInfo({
2590 2838 src: path2,
2591   - success: function (res) {
  2839 + success: function(res) {
2592 2840 //res.path是网络图片的本地地址
2593 2841 ee.data.share_head = res.path;
2594   - tt(func);;
  2842 + tt(func);
2595 2843 },
2596   - fail: function (res) {
  2844 + fail: function(res) {
2597 2845 ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
2598 2846 tt(func);
2599 2847 }
... ... @@ -2601,74 +2849,409 @@ Page({
2601 2849 }
2602 2850 },
2603 2851 //--获取商品图片的本地缓存,回调写法--
2604   - get_goods_temp:function (tt) {
2605   - var ee=this;
2606   - if(ee.data.share_goods_img) {
  2852 + get_goods_temp: function(tt) {
  2853 + var ee = this;
  2854 + if (ee.data.share_goods_img) {
2607 2855 tt();
2608 2856 return false;
2609 2857 }
2610 2858 //获取商品是分享图信息
2611 2859 wx.getImageInfo({
2612   - src: ee.data.data.original_img,
2613   - success: function (res) {
  2860 + src: ee.data.data.original_img,
  2861 + success: function(res) {
2614 2862 //res.path是网络图片的本地地址
2615 2863 ee.data.share_goods_img = res.path;
2616 2864 tt();
2617 2865 },
2618   - fail: function (res) {
2619   - ee.data.share_goods_img= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  2866 + fail: function(res) {
  2867 +
  2868 + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
2620 2869 tt();
2621 2870 }
2622 2871 });
2623 2872 },
2624 2873  
2625 2874 //--外侧评价的点击效果---
2626   - clik_evaluate:function(e){
2627   - var val=e.currentTarget.dataset.val;
  2875 + clik_evaluate: function(e) {
  2876 + var val = e.currentTarget.dataset.val;
2628 2877 this.setData({
2629   - activeCategoryId: 2, activeCategoryId3: val , comments: null
  2878 + activeCategoryId: 2,
  2879 + activeCategoryId3: val,
  2880 + comments: null
2630 2881 });
2631 2882 this.requestComments();
2632 2883 },
2633 2884  
2634 2885 //--跳转到商品详情页面--
2635   - go_goods: function (e) {
  2886 + go_goods: function(e) {
2636 2887 var gid = e.currentTarget.dataset.gid;
2637 2888 var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid;
2638 2889 getApp().goto(url);
2639 2890 },
2640 2891  
2641 2892 //--跳转到支付尾款界面--
2642   - go_pay_wk:function () {
2643   - var url = "/pages/cart/cart_wk/cart_wk?order_id="+ this.data.wk_order_id;
  2893 + go_pay_wk: function() {
  2894 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;
2644 2895 getApp().goto(url);
2645 2896 },
2646 2897  
2647   - pop_err_img:function(e){
2648   - var txt = e.currentTarget.dataset.errorimg;
2649   - var ob={};
2650   - ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
2651   - this.setData(ob);
  2898 + pop_err_img: function(e) {
  2899 + var txt = e.currentTarget.dataset.errorimg;
  2900 + var ob = {};
  2901 + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  2902 + this.setData(ob);
2652 2903 },
2653 2904  
2654 2905 //--调用更新阶梯团的接口--
2655   - update_jiti:function(id){
2656   - var th=this;
  2906 + update_jiti: function(id) {
  2907 + var th = this;
2657 2908 //--更新阶梯团--
2658   - getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/"+os.stoid+"/"+id, {
2659   - success: function (ee) {
2660   - //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--
2661   - if (ee.data.code==0) {
2662   - th.setData({
2663   - user_order_pt_state: 3,
2664   - });
2665   - }else if(ee.data.code==-1){
2666   - th.setData({
2667   - user_order_pt_state: 2,
2668   - });
  2909 + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {
  2910 + success: function(ee) {
  2911 + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--
  2912 + if (ee.data.code == 0) {
  2913 + th.setData({
  2914 + user_order_pt_state: 3,
  2915 + });
  2916 + } else if (ee.data.code == -1) {
  2917 + th.setData({
  2918 + user_order_pt_state: 2,
  2919 + });
  2920 + }
  2921 + }
  2922 + })
  2923 + },
  2924 + // 选择门店
  2925 + choice_store: function(ee) {
  2926 + var th = this;
  2927 + //var ind=ee.currentTarget.dataset.ind;
  2928 + var bconfig = th.data.bconfig;
  2929 +
  2930 + if (bconfig.is_sort_storage) {
  2931 + wx.getLocation({
  2932 + type: 'wgs84',
  2933 + success: function(res) {
  2934 +
  2935 + th.data.lat = res.latitude;
  2936 + th.data.lon = res.longitude;
  2937 + th.data.is_get_local_ok = 1;
  2938 + th.setData({
  2939 + is_gps: 1
  2940 + });
  2941 + //th.onShow();
  2942 + th.get_sto();
  2943 + },
  2944 + fail: function(res) {
  2945 + //th.onShow();
  2946 + th.get_sto();
  2947 + if (res.errCode == 2) {
  2948 + th.setData({
  2949 + is_gps: 0
  2950 + });
  2951 + if (th.data.is_gps == 0) {
  2952 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  2953 + }
  2954 + } else {
  2955 + th.setData({
  2956 + is_gps: "3"
  2957 + });
  2958 + }
  2959 +
  2960 + th.data.is_get_local_ok = 1;
  2961 + }
  2962 + })
  2963 + }else{
  2964 + th.get_sto();
  2965 + }
  2966 +
  2967 + this.setData({
  2968 + //open_ind_store: ind,
  2969 + store: 1,
  2970 + openSpecModal: !1,
  2971 + openSpecModal_pt: !1
  2972 + })
  2973 + },
  2974 + //关闭选择门店
  2975 + close_popup: function(e) {
  2976 +
  2977 + this.setData({
  2978 + store: 0,
  2979 + choice_sort_store: 0,
  2980 + sort_store: 0
  2981 + })
  2982 + },
  2983 + //选择更多门店
  2984 + more_store: function() {
  2985 + this.setData({
  2986 + sort_store: 1
  2987 + });
  2988 + },
  2989 + sort_store: function() {
  2990 +
  2991 + },
  2992 + // 返回按钮
  2993 + returns: function() {
  2994 + this.setData({
  2995 + sort_store: 0,
  2996 + choice_sort_store: 0
  2997 + });
  2998 + },
  2999 + //---选择分类门店---
  3000 + choice_sort_store: function(e) {
  3001 + var index = e.currentTarget.dataset.index;
  3002 + var region_name = e.currentTarget.dataset.region;
  3003 + var item = this.data.all_sto[index];
  3004 + this.setData({
  3005 + region_name: region_name,
  3006 + sort_store: 0,
  3007 + choice_sort_store: 1,
  3008 + sec_sto: item,
  3009 + sec_pick_index: 0
  3010 + });
  3011 + },
  3012 +
  3013 +
  3014 +
  3015 + choose_for_store_fir: function(e) {
  3016 + var index_c = e.currentTarget.dataset.ind;
  3017 +
  3018 + this.setData({
  3019 + fir_pick_index: index_c
  3020 + })
  3021 + },
  3022 +
  3023 + //确定def_pick为选择的门店
  3024 + sure_pick: function(e) {
  3025 + var th = this;
  3026 + var item = null;
  3027 + var openindstore = th.data.open_ind_store;
  3028 +
  3029 + if (th.data.choice_sort_store == 0) {
  3030 + var index = th.data.fir_pick_index;
  3031 + if (th.data.is_show_sto_cat == 1) {
  3032 + item = th.data.def_pickpu_list[index];
  3033 + } else {
  3034 + item = th.data.only_pk[index]; //当没有门店分类的时候
  3035 + }
  3036 +
  3037 + } else {
  3038 + var index = th.data.sec_pick_index;
  3039 + item = th.data.sec_sto.s_arr[index];
  3040 + }
  3041 +
  3042 + //th.setData({fir_pick_index:0});
  3043 + console.log("选择门店刷新", "def_pick_store", item);
  3044 + th.setData({
  3045 + def_pick_store: item,
  3046 + sto_sele_name: item.pickup_name,
  3047 + sto_sele_id: item.pickup_id,
  3048 + sto_sele_distr: item.distr_type,
  3049 + store: 0,
  3050 + choice_sort_store: 0,
  3051 + fir_pick_index: 0
  3052 + });
  3053 +
  3054 + if (openindstore == 1) {
  3055 + th.setData({
  3056 + openSpecModal: !0,
  3057 + openSpecModal_ind: openindstore,
  3058 + });
  3059 + } else if (openindstore == 2) {
  3060 + th.setData({
  3061 + openSpecModal: !0,
  3062 + openSpecModal_ind: openindstore,
  3063 +
  3064 + openSpecModal_pt:1
  3065 + });
  3066 + }
  3067 +
  3068 + else if (openindstore == 4) { //4就是拼团
  3069 + th.setData({
  3070 + openSpecModal_pt: 1, //打开拼团购买界面
  3071 + store: 0, //关闭门店
  3072 + choice_sort_store: 0, //关闭门店2级
  3073 + sort_store: 0, //关闭门店2级
  3074 + });
  3075 + }
  3076 +
  3077 + else {
  3078 + th.setData({
  3079 + store: 0,
  3080 + choice_sort_store: 0,
  3081 + sort_store: 0
  3082 + })
  3083 + }
  3084 +
  3085 + },
  3086 + //---点击二级之后的选择---
  3087 + choose_for_store: function(e) {
  3088 + var index_c = e.currentTarget.dataset.ind;
  3089 +
  3090 + this.setData({
  3091 + sec_pick_index: index_c,
  3092 + fir_pick_index: index_c
  3093 + })
  3094 + },
  3095 + //把选择的门店设置成默认的门店def_pick
  3096 + set_def_pick: function(e) {
  3097 + var th = this;
  3098 + var item = null;
  3099 +
  3100 + if (th.data.choice_sort_store == 0) {
  3101 +
  3102 + var index = th.data.fir_pick_index;
  3103 +
  3104 + if (th.data.is_show_sto_cat == 1) {
  3105 + item = th.data.def_pickpu_list[index];
  3106 + } else {
  3107 + item = th.data.only_pk[index]; //当没有门店分类的时候
  3108 +
  3109 + }
  3110 + } else {
  3111 + var index = th.data.sec_pick_index;
  3112 + item = th.data.sec_sto.s_arr[index];
  3113 + }
  3114 +
  3115 + var store_id = o.stoid;
  3116 + var user_id = getApp().globalData.user_id;
  3117 + var def_pickup_id = item.pickup_id;
  3118 +
  3119 + getApp().request.put('/api/weshop/users/update', {
  3120 + data: {
  3121 + user_id,
  3122 + def_pickup_id
  3123 + },
  3124 + success: function(res) {
  3125 +
  3126 + if (res.data.code == 0) {
  3127 + if (th.data.choice_sort_store == 0) th.setData({
  3128 + fir_pick_index: 0
  3129 + });
  3130 + s.showWarning("设置门店地址成功", null, 500, !1);
  3131 + getApp().globalData.pk_store = item;
  3132 + } else {
  3133 + console.log("门店地址失败");
  3134 + s.showWarning("设置默认门店地址失败", null, 500, !1);
  3135 + }
  3136 +
  3137 + }
  3138 + });
  3139 +
  3140 + th.setData({
  3141 + def_pick_store: item,
  3142 + sto_sele_name: item.pickup_name,
  3143 + sto_sele_id: item.pickup_id,
  3144 + sto_sele_distr: item.distr_type,
  3145 + store: 0,
  3146 + choice_sort_store: 0
  3147 + });
  3148 +
  3149 +
  3150 + var openindstore = th.data.open_ind_store;
  3151 + if (openindstore == 1) {
  3152 + th.setData({
  3153 + openSpecModal: !0,
  3154 + openSpecModal_ind: openindstore,
  3155 + store: 0,
  3156 + choice_sort_store: 0,
  3157 + sort_store: 0,
  3158 + });
  3159 + } else if (openindstore == 2) {
  3160 + th.setData({
  3161 + openSpecModal: !0,
  3162 + openSpecModal_ind: openindstore,
  3163 + store: 0,
  3164 + choice_sort_store: 0,
  3165 + sort_store: 0,
  3166 + });
  3167 + }
  3168 + else if (openindstore == 4) { //4就是拼团
  3169 + th.setData({
  3170 + openSpecModal_pt: 1, //打开拼团购买界面
  3171 + store: 0, //关闭门店
  3172 + choice_sort_store: 0, //关闭门店2级
  3173 + sort_store: 0, //关闭门店2级
  3174 + });
  3175 + }
  3176 +
  3177 + else {
  3178 + th.setData({
  3179 + store: 0,
  3180 + choice_sort_store: 0,
  3181 + sort_store: 0,
  3182 + })
  3183 + }
  3184 +
  3185 + },
  3186 +
  3187 + wait_for_store_config: function() {
  3188 + var th = this;
  3189 + var t_time = setInterval(function() {
  3190 + if (th.data.bconfig == null) false;
  3191 + var e = th.data.bconfig;
  3192 + if (e.is_sort_storage) {
  3193 + wx.getLocation({
  3194 + type: 'wgs84',
  3195 + success: function(res) {
  3196 + th.data.lat = res.latitude;
  3197 + th.data.lon = res.longitude;
  3198 + th.data.is_get_local_ok = 1;
  3199 + },
  3200 + fail: function(res) {
  3201 + if (res.errCode == 2) {
  3202 + th.setData({
  3203 + is_gps: 0
  3204 + });
  3205 + if (th.data.is_gps == 0) {
  3206 + getApp().confirmBox("请开启GPS定位", null, 10000, !1);
  3207 + }
  3208 +
  3209 + } else {
  3210 + th.setData({
  3211 + is_gps: "3"
  3212 + });
2669 3213 }
2670   - }
  3214 +
  3215 + th.data.is_get_local_ok = 1;
  3216 + }
  3217 + })
  3218 + } else {
  3219 + th.data.is_get_local_ok = 1;
  3220 + }
  3221 + clearInterval(t_time);
  3222 + }, 500)
  3223 + },
  3224 + //显示全部
  3225 + toggleHandler: function(e) {
  3226 + var that = this,
  3227 + index = e.currentTarget.dataset.index;
  3228 + for (var i = 0; i < that.data.comments.length; i++) {
  3229 + if (index == i) {
  3230 + for (var i = 0; i < that.data.comments.length; i++) {
  3231 + that.data.comments[index].auto = true;
  3232 + that.data.comments[index].seeMore = false;
  3233 + }
  3234 + }
  3235 + }
  3236 + that.setData({
  3237 + comments: that.data.comments
2671 3238 })
2672   - }
  3239 + },
  3240 +
  3241 + //收起更多
  3242 + toggleContent: function(e) {
  3243 + var that = this,
  3244 + index = e.currentTarget.dataset.index;
  3245 + for (var i = 0; i < that.data.comments.length; i++) {
  3246 + if (index == i) {
  3247 + that.data.comments[index].auto = true;
  3248 + that.data.comments[index].seeMore = true;
  3249 + }
  3250 + }
  3251 + that.setData({
  3252 + comments: that.data.comments
  3253 + })
  3254 + },
  3255 +
2673 3256  
2674 3257 });
2675 3258 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -2,13 +2,14 @@
2 2 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
3 3  
4 4 <wxs module="" src="filter.wxs"></wxs>
  5 +<!-- 商品内容区域,普通商品,秒杀,拼团 -->
5 6 <block wx:if="{{isshow}}">
6 7 <view class="container">
7 8 <view class="type-navbar">
8 9 <view class="type-box" wx:for="{{categories}}" wx:key="categories">
9 10 <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">
10 11 {{item.name}}
11   - </view>
  12 + </view>
12 13 </view>
13 14 </view>
14 15  
... ... @@ -43,7 +44,7 @@
43 44 </view>
44 45 <view class="xc-video-picture abs">
45 46 <view class="xc-video" data-vipi="0" bindtap="videopicture">
46   - <view class=" {{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">
  47 + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">
47 48 视频
48 49 </view>
49 50 </view>
... ... @@ -253,7 +254,7 @@
253 254 </view>
254 255  
255 256 <view class="goods-num" wx:if="{{prom_type!=1}}">
256   - <view class="sales">销量:{{data.sales_sum}}件</view>
  257 + <view class="sales">销量{{data.sales_sum}}件</view>
257 258 <view class="stock">折扣:{{data.disc}}折</view>
258 259 <view class="stock">{{categories3[0].num}}人评价</view>
259 260 </view>
... ... @@ -272,7 +273,7 @@
272 273 </view>
273 274 </view>
274 275 </view>
275   - <view style='height:42rpx'></view>
  276 +
276 277 <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0}}">
277 278 {{data.goods_name}}
278 279 </view>
... ... @@ -299,6 +300,37 @@
299 300  
300 301 </view>
301 302 </block>
  303 +
  304 + <!-- 门店收货地址 -->
  305 + <view class="xc-address_frame flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >
  306 + <view class="address_frame" bindtap="choice_store" data-ind="0">
  307 + <view class="flex-vertical-between ">
  308 + <view class="flex-vertical select_store_height">
  309 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  310 + <view class="fs30 xc-ash-9f">选择门店</view>
  311 + </view>
  312 + <view class="red_bb fs32">
  313 + 更多门店
  314 + <text class="bg_jj"></text>
  315 + </view>
  316 + </view>
  317 +
  318 + <view wx:if="{{def_pick_store}}">
  319 + <view class="flex-space-between address ai_end ">
  320 + <view>
  321 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  322 + </view>
  323 + <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}">
  324 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  325 +
  326 + </view>
  327 + </view>
  328 + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>
  329 + </view>
  330 + </view>
  331 +
  332 + </view>
  333 +
302 334 <!--许程 7.24暂时注释 -->
303 335 <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}">
304 336 <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">
... ... @@ -340,16 +372,16 @@
340 372 <view class="xc_comment-left">
341 373 <view class="xc_comment-user">
342 374 <view class="xc_user-img">
343   - <image class="xc_imgs" src='{{item.head_pic}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
  375 + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
344 376 </view>
345 377  
346 378 <view class="xc_user">
347   - <view class="xc_user-name five-level-word">{{item.username}}</view>
  379 + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>
348 380 <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
349 381 </view>
350 382 </view>
351   - <view class="xc_comment-font pj_word_size ellipsis-3">
352   - {{item.content?item.content:''}}
  383 + <view class="xc_comment-font pj_word_size ellipsis-2">
  384 + {{item.content?item.content:''}}
353 385 </view>
354 386 <view class="xc_comment-val">
355 387 <view class="xc_comment-time">{{item.add_time}}</view>
... ... @@ -357,7 +389,8 @@
357 389 </view>
358 390 </view>
359 391 <view class="xc_goods-img-frame">
360   - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  392 + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  393 + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
361 394 <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
362 395 </view>
363 396 </view>
... ... @@ -480,7 +513,7 @@
480 513  
481 514 </view>
482 515  
483   - <!------------商品详情图片页面-------------->
  516 + <!------------商品详情图片页面---------------->
484 517 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
485 518 <view class="table_s">
486 519 <view class="tb_item tb-l">
... ... @@ -553,7 +586,7 @@
553 586 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
554 587 </view>
555 588 </view>
556   - <!------------评价页面-------------->
  589 + <!---------------评价页面-------------->
557 590 <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
558 591 <view class="topframe">
559 592 <view class="topframe-top">
... ... @@ -573,26 +606,33 @@
573 606 <view style='border-bottom:4rpx solid #eee;'>
574 607 <view class="middle">
575 608 <view class="middle-img-frame">
576   - <image class="middle-img" src="{{item.head_pic}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
  609 + <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
577 610 <view class="middle-user-frame">
578   - <view class="middle-user">{{item.username==''?'匿名用户':item.username}}</view>
  611 + <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view>
579 612 <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
580 613 </view>
581 614 </view>
582 615 <view class="xc-pirces">
583   - <text class="middle-font">
  616 + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >
584 617 {{item.content?item.content:''}}
585   - </text>
  618 + </view>
586 619 </view>
  620 + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>
  621 + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>
587 622 <view class="img-ul">
588   - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
589   - <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}"
590   - data-id="{{index}}" src="{{iurl}}{{item}}"></image>
591   - </view>
592   - </view>
593 623  
594   - <view class="iddle-goods-img">
595   - <image bindtap="previewCommentImgs" class="goods-img" wx:for="{{item.img}}" wx:key="{{index}}" data-cidx="{{cIdx}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  624 + <block wx:if="{{item.source_type==0}}">
  625 + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
  626 + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}"
  627 + data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  628 + </view>
  629 + </block>
  630 + <block wx:if="{{item.source_type==1}}">
  631 + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">
  632 + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}"
  633 + data-id="{{index}}" src="{{aitem}}"></image>
  634 + </view>
  635 + </block>
596 636 </view>
597 637  
598 638 <view class="z_parameter">
... ... @@ -614,8 +654,11 @@
614 654 </view>
615 655 </view>
616 656 </block>
617   - <block wx:if="{{comments.length==0 && get_c}}">
618   - <text class="no_pj_list">暂无评价</text>
  657 + <block wx:if="{{(!comments || comments.length==0) && get_c }}">
  658 + <text class="no_pj_list">暂无评价</text>
  659 + </block>
  660 + <block wx:if="{{comments.length>10 && comments_no_more}}">
  661 + <text class="no_pj_list">已经加载到底部</text>
619 662 </block>
620 663 </view>
621 664 </view>
... ... @@ -624,6 +667,7 @@
624 667 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
625 668 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
626 669 </view>
  670 +
627 671 <!-------------------底部按钮-------------------->
628 672 <view class="join-cart">
629 673 <view bindtap="contactService" class="custom-service cart-ico new_split">
... ... @@ -642,15 +686,19 @@
642 686 <view>购物车</view>
643 687 </navigator>
644 688 </view>
645   - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>-->
  689 + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
  690 +
  691 + <!---- 普通商品购买 ----->
646 692 <block wx:if="{{prom_type==0}}">
647 693  
648   - <block wx:if="{{data.store_count>0}}">
649   - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
650   - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
  694 + <block wx:if="{{sele_g.store_count>0}}">
  695 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
  696 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
651 697 </block>
652   - <block wx:else>
653   - <view data-ind="1" class="join-btn cart-btn no_store">库存不足</view>
  698 + <block wx:else>
  699 + <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">
  700 + 库存不足
  701 + </view>
654 702 </block>
655 703  
656 704 </block>
... ... @@ -722,51 +770,77 @@
722 770 <nav_box></nav_box>
723 771  
724 772 </block>
725   -
726 773 <!----弹起来,选择规格数量,普通商品购买和秒杀------>
727 774 <view hidden="{{!openSpecModal}}">
728 775 <view bindtap="closeSpecModal" class="cover-layer"></view>
729 776 <view class="spec-model">
730   - <view class="pding">
731   - <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
  777 + <view class="pding">
  778 + <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
732 779 <view class="spec-goods">
733   - <image class="wh100 spec-img" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  780 + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
734 781 <view class="spec-goods-info">
735   - <!--<view class="spec-goods-name">{{data.goods_name}}</view>-->
736   - <view class="spec-goods-price" wx:if="{{prom_price==null}}">¥ {{sele_g.shop_price}}</view>
737   - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
  782 + <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
  783 + <view class="flex ai_end xc-val-money">
  784 + <view class="spec-goods-price" wx:if="{{prom_price==null}}"><text class="fs20">¥</text>{{sele_g.shop_price}}</view>
  785 + <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
  786 +
  787 + </view>
  788 +
738 789 <block wx:if="{{prom_type==0}}">
  790 + <view class="flex">
739 791 <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
740 792 <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
741   - <view class="spec-goods-stock">已选:{{sele_g.gg}}</view>
  793 +
  794 +
  795 + </view>
742 796 </block>
743 797 <block wx:if="{{prom_type==1}}">
  798 + <view class="flex">
744 799 <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
745 800 <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
746 801 <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
747   - <view class="spec-goods-stock">已选:{{sele_g.gg}}</view>
  802 +
  803 +
  804 + </view>
748 805 </block>
749 806 </view>
750   - </view>
  807 +
  808 + <!-- 选择门店模块 -->
  809 + <view class="flex-space-between address ai_end xc-width ">
  810 +
  811 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  812 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  813 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  814 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  815 +
  816 + </view>
  817 + </view>
  818 +
  819 + <!-- 没有门店的时候 -->
  820 + <view class="flex" bindtap="choice_store"wx:else>
  821 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  822 + <view class="fs28 xc-ash-9f">选择门店</view>
  823 + </view>
  824 +
  825 + <view class="red-co fs28" bindtap="choice_store" >
  826 + 更多门店
  827 + <text class="right-arrow"></text>
  828 + </view>
  829 + </view>
  830 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  831 + </view>
  832 +
751 833 <!----商品的属性项目---->
  834 + <view class="xc-goods-attribute">
752 835 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
753 836 <view hidden="{{ismend==1}}" class="flex">
754 837 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
755 838 {{item.gg}}
756 839 </view>
757 840 </view>
  841 +</view>
  842 +
758 843  
759   - <!----点击选择门店的时候要隐藏---->
760   - <view hidden="{{ismend==1}}">
761   - <view bindtap="getmendian" class="quhuo logistics-item">
762   - <view wx:if="{{sto_sele_name==''}}">取货门店
763   - <text class='small'>(选择门店)</text>
764   - </view>
765   - <view wx:else>取货门店({{sto_sele_name}})</view>
766   - <view class="item-img">
767   - <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>
768   - </view>
769   - </view>
770 844 <view class="b_num">
771 845 <view>购买数量</view>
772 846 <view class="count">
... ... @@ -776,6 +850,14 @@
776 850 </view>
777 851 </view>
778 852 </view>
  853 + <view class="spec-cart-btns">
  854 +
  855 +
  856 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  857 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  858 +
  859 + </view>
  860 +
779 861 <view class="clear"></view>
780 862 <!---选择门店的列表--->
781 863 <view hidden="{{ismend==0}}" class="sto_v">
... ... @@ -801,13 +883,7 @@
801 883 </view>
802 884 </view>
803 885 </view>
804   - <view class="spec-cart-btns">
805   - <block>
806   - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="add">加入购物车</view>
807   - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
808   - </block>
809   - </view>
810   - </view>
  886 +
811 887 </view>
812 888 <!----弹起来,选择规格数量,拼单商品购买------>
813 889 <view hidden="{{!openSpecModal_pt}}">
... ... @@ -818,7 +894,7 @@
818 894 <view class="spec-goods">
819 895 <image class="wh100 spec-img" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
820 896 <view class="spec-goods-info">
821   - <!--<view class="spec-goods-name">{{data.goods_name}}</view>-->
  897 + <!-- <view class="spec-goods-name ellipsis-1">{{data.goods_name}}</view> -->
822 898 <view class="spec-goods-price" wx:if="{{is_normal==1}}">¥ {{sele_g.shop_price}}</view>
823 899 <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
824 900  
... ... @@ -834,9 +910,35 @@
834 910 </block>
835 911 </view>
836 912 </view>
  913 +
  914 + <view style="clear: both"></view>
  915 + <view style="margin-top: 20rpx">
  916 + <view class="flex-space-between address ai_end xc-width ">
  917 +
  918 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  919 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  920 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  921 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  922 +
  923 + </view>
  924 + </view>
  925 +
  926 + <!-- 没有门店的时候 -->
  927 + <view class="flex" bindtap="choice_store"wx:else>
  928 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  929 + <view class="fs28 xc-ash-9f">选择门店</view>
  930 + </view>
  931 +
  932 + <view class="red-co fs28" bindtap="choice_store" >
  933 + 更多门店
  934 + <text class="right-arrow"></text>
  935 + </view>
  936 + </view>
  937 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  938 + </view>
837 939 <!----商品的属性项目---->
  940 + <view>
838 941 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
839   -
840 942 <block wx:if="{{is_normal==0}}">
841 943 <view hidden="{{ismend==1}}" class="flex">
842 944 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
... ... @@ -851,22 +953,27 @@
851 953 </view>
852 954 </block>
853 955 <view class="clear"></view>
  956 + </view>
  957 +
854 958  
855 959 <view>
856   - <view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">
857   - <view wx:if="{{sto_sele_name==''}}">取货门店
858   - <text class='small'>(选择门店)</text>
859   - </view>
860   - <view wx:else>{{sto_sele_name}}</view>
861   - <view class="item-img">
862   - <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>
863   - </view>
864   - </view>
865   - <view class="b_num" hidden="{{ismend==1}}">
  960 +
  961 + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
  962 + <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
  963 + <!--<text class='small'>(选择门店)</text>-->
  964 + <!--</view>-->
  965 + <!--<view wx:else>{{sto_sele_name}}</view>-->
  966 + <!--<view class="item-img">-->
  967 + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
  968 + <!--</view>-->
  969 + <!--</view>-->
  970 +
  971 +
  972 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
866 973 <view>购买数量</view>
867 974 <view class="count">
868 975 <view bindtap="subCartNum" class="sub">-</view>
869   - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  976 + <input bindblur="inputCartNum xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
870 977 <view bindtap="addCartNum" class="add">+</view>
871 978 </view>
872 979 </view>
... ... @@ -896,12 +1003,13 @@
896 1003 </view>
897 1004 </view>
898 1005 </view>
899   - </view>
  1006 + </view>
900 1007 <view class="pt_qd">
901 1008 <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
902 1009 </view>
903 1010 </view>
904 1011 </view>
  1012 +<!----弹起来优惠信息------>
905 1013 <view hidden="{{!openPromModal}}">
906 1014 <view bindtap="closePromModal" class="cover-layer"></view>
907 1015 <view class="prom-model">
... ... @@ -991,9 +1099,152 @@
991 1099 </view>
992 1100 </view>
993 1101  
  1102 +<!-- 选择门店的弹框,1.1版最新的 -->
  1103 +<block wx:if="{{store==1}}">
  1104 + <view class="mongolia-layer" bindtap="close_popup"></view>
  1105 + <view class="popup-frame">
  1106 + <block wx:if="{{sort_store==0}}">
  1107 + <!-- 头部 标题 -->
  1108 + <view class="popup-top flex-space-between">
  1109 + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
  1110 + <view>
  1111 + <view>
  1112 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
  1113 + </view>
  1114 + <view class="felx choose_more" bindtap="more_store">
  1115 + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text>
  1116 + <view class="bg_rights"></view>
  1117 + </view>
  1118 + </view>
  1119 + </view>
  1120 + <!-- 门店列表,最外层的门店列表,一开始 -->
  1121 + <view class="store-list">
  1122 + <!--如果还没有点击更多门店的时候 -->
  1123 + <block wx:if="{{choice_sort_store==0}}">
  1124 + <!-- 需要for循环 -->
  1125 + <block wx:if="is_show_sto_cat==1">
  1126 + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  1127 + <view class="store flex-vertical">
  1128 + <!-- 需要点击事件 -->
  1129 + <block wx:if="{{index==fir_pick_index}}">
  1130 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1131 + </block>
  1132 + <block wx:else>
  1133 + <view class="circle xc-hooks"></view>
  1134 + </block>
  1135 + <view class="address-frame xc-ash">
  1136 + <view class="flex-vertical-between butttem5">
  1137 + <view class="flex xc-ash">
  1138 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  1139 + </view>
  1140 + <view>
  1141 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">
  1142 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view>
  1143 + </view>
  1144 + </view>
  1145 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1146 + </view>
  1147 + </view>
  1148 + </view>
  1149 + </block>
  1150 + <block wx:else>
  1151 + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  1152 + <view class="store flex-vertical">
  1153 + <!-- 需要点击事件 -->
  1154 + <block wx:if="{{index==fir_pick_index}}" >
  1155 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1156 + </block>
  1157 + <block wx:else>
  1158 + <view class="circle xc-hooks"></view>
  1159 + </block>
  1160 +
  1161 + <view class="address-frame xc-ash">
  1162 + <view class="flex-vertical-between ">
  1163 + <view class="flex xc-ash">
  1164 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  1165 + </view>
  1166 + <view>
  1167 + <view class="distance fs24 address-val"
  1168 + wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
  1169 + </view>
  1170 + </view>
  1171 + </view>
  1172 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1173 + </view>
  1174 + </view>
  1175 + </view>
  1176 + </block>
  1177 + </block>
  1178 + <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 -->
  1179 + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store">
  1180 + <view class="store flex-vertical">
  1181 + <!-- 需要点击事件 -->
  1182 + <block wx:if="{{index==sec_pick_index}}">
  1183 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1184 + </block>
  1185 + <block wx:else>
  1186 + <view class="circle xc-hooks"></view>
  1187 + </block>
  1188 +
  1189 + <view class="address-frame xc-ash">
  1190 + <view class="flex-vertical-between ">
  1191 + <view class="flex xc-ash">
  1192 + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
  1193 + </view>
  1194 + <view>
  1195 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view>
  1196 + </view>
  1197 + </view>
  1198 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1199 + </view>
  1200 + </view>
  1201 + </view>
  1202 + </block>
  1203 +
  1204 + </view>
  1205 +
  1206 + <!-- 门店列表底部 -->
  1207 + <view class="store-bottom-frame">
  1208 + <view class="store-bottom flex-vertical-between">
  1209 + <view class="determine red-b fs28 white t-c" bindtap="sure_pick"
  1210 + data-openindstore="{{open_ind_store}}">确定</view>
  1211 + <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view>
  1212 + </view>
  1213 + </view>
  1214 +
  1215 + </block>
  1216 +
  1217 +
  1218 + <block wx:else>
  1219 + <view class="popup-top flex-space-between">
  1220 + <text class="fs32 nearby_store">门店分类选择</text>
  1221 + <view>
  1222 + <view>
  1223 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
  1224 + </view>
  1225 + <view class="felx choose_mores" bindtap="returns">
  1226 + <text class="fs26 red-co">返回</text>
  1227 + </view>
  1228 + </view>
  1229 + </view>
  1230 + <view class="sort_store_list">
  1231 +
  1232 + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
  1233 + <view class="sort-store flex-vertical-between" >
  1234 + <view class="fs30" di>{{item.name}}</view>
  1235 + <view class="black_rights-frame">
  1236 + <view class="black_rights"></view>
  1237 + </view>
  1238 + </view>
  1239 + </view>
  1240 +
  1241 + </view>
  1242 + </block>
  1243 + </view>
  1244 +</block>
  1245 +
  1246 +
994 1247 <!-- ---------------分享弹窗--------------- -->
995 1248 <!--二维码显示页面-->
996 1249 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas>
997   -
998   -
999 1250 <warn id="warn"></warn>
1000 1251 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -26,6 +26,9 @@ image {
26 26 }
27 27 .type-navbar-item {
28 28 border-bottom: 4rpx solid #fff;
  29 + display: flex;
  30 + justify-content: center;
  31 + width: 100%;
29 32 }
30 33 .type-item-on {
31 34 border-bottom: 4rpx solid #333;
... ... @@ -282,6 +285,7 @@ image {
282 285 width: 150rpx;
283 286 height: 150rpx;
284 287 margin-top: 8rpx;
  288 + margin-right: 10rpx;
285 289 }
286 290  
287 291 .comment-btn {
... ... @@ -321,6 +325,9 @@ image {
321 325 height: 100rpx;
322 326 background-color: #fff;
323 327 text-align: center;
  328 + z-index: 9;
  329 + border-top: 4rpx solid #eee;
  330 +
324 331 }
325 332  
326 333 .join-cart>view {
... ... @@ -355,7 +362,7 @@ image {
355 362 .cart-num {
356 363 position: absolute;
357 364 left: 50%;
358   - top: 0;
  365 + top: 1rpx;
359 366 width: 40rpx;
360 367 height: 40rpx;
361 368 line-height: 40rpx;
... ... @@ -368,11 +375,19 @@ image {
368 375 .cart-btn {
369 376 font-size: 28rpx;
370 377 color: #fff;
371   - line-height: 100rpx;
  378 + line-height: 70rpx;
  379 + margin-top: 16rpx;
  380 +
  381 +
372 382 }
373 383  
374 384 .join-btn {
375 385 background-color: #ffb03f;
  386 + height: 70rpx;
  387 +border-radius: 55rpx 0rpx 0rpx 55rpx;
  388 +margin-top: 16rpx;
  389 +
  390 +
376 391 }
377 392  
378 393 view.cart-btn-lg {
... ... @@ -381,6 +396,9 @@ view.cart-btn-lg {
381 396  
382 397 .buy-btn {
383 398 background-color: #f23030;
  399 + height: 70rpx;
  400 +border-radius: 0 56rpx 55rpx 0;
  401 +
384 402 }
385 403  
386 404 .toTop {
... ... @@ -505,24 +523,23 @@ view.cart-btn-lg {
505 523 /* padding: 0 30rpx; */
506 524 font-size: 32rpx;
507 525 box-sizing: border-box;
508   -
  526 + border-radius: 20rpx;
  527 + height: 72%;
509 528 }
510 529  
511 530 .spec-model .pding{padding: 0 30rpx;}
512 531  
513 532 .spec-goods {
514   - padding: 15rpx 0 10rpx;
  533 + padding: 30rpx 0 20rpx;
515 534 float: left;
516 535 width: 100%;
517   - border-bottom: 1px solid #f8f8f8;
  536 + border-bottom:2rpx solid #eee;
518 537 }
519 538  
520 539 .spec-img {
521 540 float: left;
522 541 height: 186rpx;
523 542 width: 186rpx;
524   - position: relative;
525   - top:-40rpx;
526 543 border: 4rpx solid #eee
527 544 }
528 545  
... ... @@ -542,7 +559,7 @@ view.cart-btn-lg {
542 559 }
543 560  
544 561 .spec-goods-price {
545   - color: #ec5151;
  562 + color: #d60021;
546 563 font-size: 33rpx;
547 564 font-weight: bold;
548 565 }
... ... @@ -551,6 +568,7 @@ view.cart-btn-lg {
551 568 margin-top: 3rpx;
552 569 font-size: 24rpx;
553 570 color: #999999;
  571 + margin-right: 15rpx;
554 572 }
555 573  
556 574 .spec-name {
... ... @@ -568,7 +586,7 @@ view.cart-btn-lg {
568 586 position: fixed;
569 587 display: flex;
570 588 height: 50rpx;
571   - border: 1rpx solid #f8f8f8;
  589 + border: 1rpx solid #000;
572 590 font-size: 28rpx;
573 591 right: 30rpx;
574 592 }
... ... @@ -581,15 +599,15 @@ view.cart-btn-lg {
581 599 text-align: center;
582 600 }
583 601 .spec_bt{
584   - background: fff;color: #333; margin-left: 10rpx;padding: 8rpx 12rpx; border-radius: 5px;font-size: 24rpx;border: 1rpx solid #ccc;
  602 + background: fff;color: #333; margin-left: 10rpx;padding: 4rpx 15rpx 4rpx; border-radius:30rpx;font-size: 24rpx;border: 1rpx solid #ccc;
585 603 }
586   -.spec_bt.act{background: #C4182E;color: #fff;border: 1rpx solid #C4182E;}
  604 +.spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;}
587 605 .sub {
588   - border-right: 1px solid #ddd;
  606 + border-right: 1px solid #000;
589 607 }
590 608  
591 609 .add {
592   - border-left: 1px solid #ddd;
  610 + border-left: 1px solid #000;
593 611 }
594 612  
595 613 .spec-btn {
... ... @@ -611,22 +629,24 @@ view.cart-btn-lg {
611 629 }
612 630  
613 631 .spec-cart-btns {
614   - /* background-color: #f8f8f8;
615   - margin: 40rpx -30rpx 0;
616   - padding: 20rpx 34rpx; */
617   - float: left;
618   - width: 100%;
619   - line-height: 80rpx;
620   - margin-top: 40rpx;
  632 + width: 92%;
  633 + line-height: 70rpx;
  634 + margin: 0rpx auto;
  635 + margin-top: 160rpx;
  636 + border-radius: 20rpx;
  637 +position: fixed;
  638 +bottom: 50rpx;
  639 +left: 4%;
  640 +
621 641 }
622 642  
623 643 .spec-cart-btn {
624   - float: left;
625   - width: 100%;
  644 +
  645 + width:100%;
626 646 font-size: 30rpx;
627 647 text-align: center;
628 648 color: white;
629   - border-radius: 4rpx;
  649 + border-radius: 40rpx;
630 650 }
631 651  
632 652 .spec-add-cart {
... ... @@ -718,7 +738,8 @@ left:31rpx;}
718 738  
719 739 .pt_fir .pt_fir_title .js{padding: 0 15rpx;height: 40rpx;background:#e9030d; text-align: center; border-radius: 8rpx; color: #fff; margin-left: 10rpx;}
720 740 .pt_fir .pt_fir_title .tuannum{color: #e9030d; position: absolute; right: 20rpx; font-size: 26rpx;}
721   -.pding{padding-top: 20rpx;padding-left: 20rpx; padding-right: 20rpx;font-size: 26rpx;color: #ea120f}
  741 +.pding{padding-top: 20rpx;padding-left: 20rpx;height: 81%;
  742 + padding-right: 20rpx;font-size: 26rpx;color: #ea120f}
722 743 .pdres{margin-left: 10rpx;color: #8f8f94}
723 744 .ptgz{position: relative;font-size: 30rpx;padding-left: 20rpx;margin-top: 10rpx; overflow: hidden }
724 745 .shuxian{width: 6rpx;height: 28rpx; background: #ea120f; display: inline-block;top: 5rpx;position: relative; margin-right: 5rpx}
... ... @@ -741,7 +762,7 @@ left:31rpx;}
741 762 .wf .item .item_txy.hs{ background: #cbcbcb;}
742 763 .po{margin-bottom: 20rpx;}
743 764  
744   -.cart-btn.line-h{ line-height: 40rpx;}
  765 +.cart-btn.line-h{ line-height: 26rpx;}
745 766 .cart-btn .fir-v{ margin-top: 10rpx;}
746 767  
747 768 .hyt{ padding: 0 20rpx; font-size: 30rpx; display: flex; align-items:center; margin-top: 10rpx;}
... ... @@ -777,7 +798,7 @@ left:31rpx;}
777 798 .juzhong .xq .title .close{position: absolute;top: 0; right: 0; width: 45rpx; height: 45rpx;}
778 799  
779 800 .pt_qd{margin-top: 40rpx; height: auto;}
780   -.spec-cart-btn.w100{width: 100%; margin-left: 0; height: 80rpx; line-height: 80rpx;}
  801 +.spec-cart-btn.w100{width: 95%; margin-left: 0; height: 75rpx; line-height:75rpx;margin: auto; }
781 802  
782 803 .sto_v{color: #333;}
783 804 .ellipsis{overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
... ... @@ -927,14 +948,13 @@ left:31rpx;}
927 948 border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; line-height: 100rpx }
928 949  
929 950 .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333;
930   - font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:31rpx }
  951 + font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx }
931 952 .red_bb{ color: #d70026; min-width:158rpx;width: auto;}
932 953 .bg_jj{ width: 18rpx; height:18rpx;
933 954 border-top: 2rpx solid #d70026;
934 955 border-right: 2rpx solid #d70026;
935 956 transform: rotate(45deg);display:inline-block;
936 957 margin-bottom:3rpx;
937   -
938 958 }
939 959 /* 顶部边框 */
940 960 .topframe{
... ... @@ -952,7 +972,7 @@ left:31rpx;}
952 972 margin-bottom: 36rpx;
953 973 color: #7d7d7d;
954 974 padding-left: 20rpx;
955   - font-size: 28rpx;
  975 + font-size: 32rpx;
956 976 }
957 977 /*评价人数量*/
958 978 .topframe .topframe-top .topframe-top-val{
... ... @@ -980,7 +1000,7 @@ left:31rpx;}
980 1000  
981 1001 .buttem-list .item{
982 1002 min-width: 17%;
983   - font-size: 23rpx;
  1003 + font-size: 24rpx;
984 1004 border-radius: 20rpx;
985 1005 background:#ffe3e2;
986 1006 height:38rpx;
... ... @@ -996,16 +1016,11 @@ left:31rpx;}
996 1016  
997 1017 /* 用户评价 */
998 1018 .middle{
999   -
1000 1019 width: 95%;
1001   - height:auto;
1002   -
1003 1020 margin:0 auto;
1004   -
1005   -
1006 1021 }
1007 1022 .middle-img-frame{
1008   - height:65rp;
  1023 + height:65rpx;
1009 1024 display: flex;
1010 1025 margin-top: 32rpx;
1011 1026  
... ... @@ -1035,11 +1050,13 @@ left:31rpx;}
1035 1050 text-align: center;
1036 1051 margin-bottom:20rpx;
1037 1052 margin-left:5rpx;
1038   -
  1053 +}
  1054 +.xc-pirces{
  1055 + margin-top: 14rpx;
1039 1056 }
1040 1057 /* 评价文字 */
1041 1058 .middle-font{
1042   - font-size: 24rpx;
  1059 + font-size: 30rpx;
1043 1060  
1044 1061 }
1045 1062 .iddle-goods-img{
... ... @@ -1065,11 +1082,12 @@ left:31rpx;}
1065 1082 height: 45rpx;
1066 1083 display:flex;
1067 1084 line-height: 45rpx;
  1085 + margin-top: 20rpx;
1068 1086 margin-bottom: 14rpx;
1069 1087 justify-content : space-between;
1070 1088 }
1071 1089 .parameter-font{
1072   - font-size: 24rpx;
  1090 + font-size: 26rpx;
1073 1091  
1074 1092 }
1075 1093 /* 规格 */
... ... @@ -1091,13 +1109,13 @@ left:31rpx;}
1091 1109 }
1092 1110 /* 点赞图片 */
1093 1111 .parameter-img{
1094   - width: 25rpx;
1095   - height: 25rpx;
  1112 + width: 27rpx;
  1113 + height: 27rpx;
1096 1114 margin-top: 3rpx;
1097 1115 }
1098 1116 .parameter-val{
1099 1117 margin-left:25rpx;
1100   - font-size: 24rpx;
  1118 + font-size: 26rpx;
1101 1119 color: #999;
1102 1120 }
1103 1121 /* 回复 */
... ... @@ -1170,7 +1188,7 @@ left:31rpx;}
1170 1188 width: 524rpx;
1171 1189 margin-left: 34rpx;
1172 1190 border-radius: 25rpx;
1173   - border: 1rpx solid #d6d4d5;
  1191 + border: 2rpx solid #d6d4d5;
1174 1192 overflow: hidden;
1175 1193 }
1176 1194  
... ... @@ -1197,19 +1215,20 @@ left:31rpx;}
1197 1215 margin-right: 5rpx
1198 1216 }
1199 1217 .xc_comment-font{
1200   - height: 85rpx;
  1218 + height: 75rpx;
1201 1219 margin-left: 22rpx;
1202 1220 white-space:normal;
1203 1221 overflow: hidden;
1204 1222 margin-top: 8rpx;
  1223 +
1205 1224 }
1206 1225 .xc_comment-val{
1207 1226 width: 88%;
1208 1227 height: 30rpx;
1209 1228 margin-left: 22rpx;
1210 1229 display: flex;
1211   - margin-top: 28rpx;
1212   - margin-bottom:8rpx;
  1230 + margin-top: 15rpx;
  1231 + margin-bottom:15rpx;
1213 1232 }
1214 1233  
1215 1234 .xc_comment-time{
... ... @@ -1266,7 +1285,7 @@ left:31rpx;}
1266 1285 height: 100%;
1267 1286 line-height: 100rpx;
1268 1287 overflow: hidden;
1269   - margin-left: 7rpx;
  1288 + margin-left: 10rpx;
1270 1289 }
1271 1290 .xc-coupon-fram{
1272 1291 position: relative;
... ... @@ -1306,7 +1325,7 @@ left:31rpx;}
1306 1325 padding-left:15rpx;
1307 1326 color: #d70025;
1308 1327 position: absolute;
1309   - right: 7rpx;
  1328 + right: 5rpx;
1310 1329 }
1311 1330  
1312 1331 /* 自定义弹出窗口 */
... ... @@ -2221,9 +2240,247 @@ right:17rpx; top:55rpx;
2221 2240 .pd_top1{padding-top: 10rpx}
2222 2241 .s_ms_bth{margin-top: 85rpx}
2223 2242  
2224   -.xc-pirces{
2225   - height:40rpx;
2226   - line-height:15rpx;
  2243 +
  2244 +.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx}
  2245 +/* 门店地址 */
  2246 +.xc-address_frame{
  2247 + border-top:1rpx solid #eee;
  2248 + width: 100%;
  2249 + height: auto;
  2250 +}
  2251 +.on_height{
  2252 +height: 90rpx;
  2253 +}
  2254 +.sn_height{
  2255 + height: 170rpx;
  2256 +}
  2257 +.xc-address_frame .address_frame{
  2258 + width: 92%;
  2259 +padding-left: 10rpx;
  2260 +margin: auto;
  2261 +
  2262 +}
  2263 +.shop_name{
  2264 +
  2265 +}
  2266 +.stores-img{
  2267 +width: 40rpx;
  2268 + height: 35rpx;
  2269 + margin-right: 10rpx;
  2270 +}
  2271 +.shop_name{
  2272 + margin-right: 10rpx;
  2273 +}
  2274 +.address{
  2275 + width: 87%;
  2276 + margin-top: 5rpx;
  2277 + margin-bottom: 5rpx;
  2278 +}
  2279 +.distance{
  2280 + padding-left: 15rpx;
  2281 + padding-right: 15rpx;
  2282 + background: #eee;
  2283 + border-radius: 20rpx;
  2284 + margin-right: 5rpx;
  2285 + color: #999;
  2286 + height: 38rpx;
  2287 +line-height: 38rpx;
  2288 +
  2289 +}
  2290 +/* 选择门店的弹窗 */
  2291 +.mongolia-layer{
  2292 + position: fixed;
  2293 +left: 0;
  2294 +top: 0;
  2295 +right: 0;
  2296 +bottom: 0;
  2297 +z-index: 11;
  2298 +background: rgba(0,0,0,0.4);
  2299 +width: 100%;
  2300 +height: 91.9%;
  2301 +
  2302 +}
  2303 +.popup-frame{
  2304 + position: fixed;
  2305 +bottom:99rpx;
  2306 +z-index: 20;
  2307 +background: white;
  2308 +width: 100%;
  2309 +border-radius: 20rpx 20rpx 0 0;
  2310 +height: 72%;
  2311 +}
  2312 +.popup-top{
  2313 + border-bottom: 1rpx solid #eee;
  2314 + height: 155rpx;
  2315 + width: 95%;
  2316 + margin: auto;
  2317 + line-height: 155rpx;
  2318 +
  2319 +}
  2320 +.bg_rights{
  2321 + border-top: 2rpx solid ;
  2322 + border-right: 2rpx solid ;
  2323 + transform: rotate(45deg);
  2324 + display:inline-block;
  2325 + width:15rpx;height:15rpx;
  2326 + border-color:#da0b31;
  2327 +}
  2328 +.modal-closes {
  2329 + position: absolute;
  2330 + right: 30rpx;
  2331 + top: -15rpx;
  2332 + height: 25rpx;
  2333 +
  2334 +}
  2335 +.choose_more{
  2336 + margin-top: 40rpx;
  2337 + margin-right: 20rpx;
  2338 +
  2339 +}
  2340 +.choose_mores{
  2341 + margin-top: 30rpx;
  2342 + margin-right: 15rpx;
  2343 +
  2344 +}
  2345 +.store-list{
  2346 + width: 95%;
  2347 + height: 72%;
  2348 + overflow-y: scroll;
  2349 + margin: auto;
  2350 +}
  2351 +.store-list .store_choose{
  2352 + width: 100%;
  2353 + height: 120rpx;
  2354 + line-height: 125rpx;
  2355 + border-bottom: 1rpx solid #eee;
  2356 +
  2357 +}
  2358 +.store-list .store_choose .store{
  2359 +width: 100%;
  2360 +margin: auto;
  2361 +line-height: 37rpx;
  2362 +padding-left: 20rpx;
  2363 +
  2364 +}
  2365 +.xc-hook{
  2366 + width: 35rpx;
  2367 + height: 35rpx;
  2368 + transform: rotate(-145deg);
  2369 +line-height: 37rpx;
  2370 +text-align: center;
  2371 +}
  2372 + .xc-hooks{
  2373 + width: 30rpx;
  2374 + height: 30rpx;
  2375 + border: 1rpx solid #999;
  2376 + }
  2377 + .address-frame{
  2378 + width: 93%;
  2379 +margin-left: 7rpx;
  2380 +
  2381 + }
  2382 + .nearby_store{
  2383 +margin-left: 17rpx;
  2384 + }
  2385 + .address_name{
  2386 + margin-right: 10rpx;
  2387 +
  2388 + }
  2389 + .address-val{
  2390 + height: 38rpx;
  2391 +line-height: 38rpx;
  2392 +
  2393 + }
  2394 + .store-bottom{
  2395 + width: 85%;
  2396 + margin: auto;
  2397 + height: 70rpx;
  2398 + }
  2399 + .determine{
  2400 + width: 260rpx;
  2401 + height: 55rpx;
  2402 + border-radius: 50rpx;
  2403 + line-height: 55rpx;
  2404 + }
  2405 + .default{
  2406 + width: 260rpx;
  2407 + height: 55rpx;
  2408 + border:3rpx solid #c8c8c8;
  2409 + border-radius: 50rpx;
  2410 + line-height: 55rpx;
  2411 + }
  2412 + .store-bottom-frame{
  2413 + width: 95%;
  2414 + margin: auto;
  2415 +
  2416 + }
  2417 + /* 门店分类列表 */
  2418 +.sort_store_list{
  2419 + height: 82%;
  2420 + overflow: hidden;
  2421 + overflow-y: scroll;
  2422 + width: 95%;
  2423 + margin: auto;
  2424 +}
  2425 +.sort_store_list .sort-store-frame{
  2426 + width: 100%;
  2427 +height: 100rpx;
  2428 +line-height:100rpx;
  2429 +border-bottom: 1rpx solid #eee;
  2430 +
  2431 +}
  2432 +.sort_store_list .sort-store-frame .sort-store{
  2433 + width: 94.5%;
  2434 + margin: auto;
  2435 +}
  2436 +.black_rights-frame{
  2437 +width: 50%;
  2438 +}
  2439 +.black_rights-frame .black_rights{
  2440 + border-top: 3rpx solid;
  2441 +border-right: 3rpx solid;
  2442 +transform: rotate(45deg);
  2443 +display: inline-block;
  2444 +width: 20rpx;
  2445 +height: 20rpx;
  2446 +}
  2447 +.xc-val-money{
  2448 + height:80rpx;
  2449 +}
  2450 +
  2451 +.xc-distance-bottom{
  2452 + margin-bottom: 40rpx;
  2453 +}
  2454 +.xc-distance-top{
  2455 +margin-top: 10rpx;
  2456 +}
  2457 +.xc-width{
  2458 + width: 100%;
  2459 +}
  2460 +.right-arrow{ width: 15rpx; height:15rpx;
  2461 + border-top: 2rpx solid #d70026;
  2462 + border-right: 2rpx solid #d70026;
  2463 + transform: rotate(45deg);display:inline-block;
  2464 + margin-bottom:3rpx;
  2465 +}
  2466 +.xc-goods-attribute{
  2467 + border-bottom: 1px solid #eee;
  2468 +padding-bottom: 15px;
  2469 +margin-bottom:40rpx;
  2470 +}
  2471 +.xc-val-fream{
  2472 + width: 105rpx;
  2473 +}
  2474 +.is_stock{
  2475 +width: 58%;
  2476 +height: 70rpx;
  2477 +border-radius: 55rpx;
  2478 +}
  2479 +.select_store_height{
  2480 + height: 50rpx;
  2481 +}
  2482 +.butttem5{
  2483 + margin-bottom: 5rpx;
2227 2484 }
2228 2485  
2229 2486 .no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx}
... ... @@ -2233,3 +2490,4 @@ right:17rpx; top:55rpx;
2233 2490 width: 58%; background-color: #adadad;
2234 2491 }
2235 2492  
  2493 +.s_btn{ margin-top: 25rpx; }
... ...
pages/index/index/index.js
1 1 var e = function (e) {
2 2 return e && e.__esModule ? e : {
3   - default: e
  3 + default: e
4 4 };
5 5 }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o,
6 6 i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default();
... ...
pages/user/add_comment/add_comment.js
1   -var t = getApp(),oo=t.globalData, a = t.globalData.setting,os=a, e = t.request, s = require("../../../utils/util.js"),
2   - i = require("../../../utils/selectFiles.js");
  1 +var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../utils/util.js"),
  2 + i = require("../../../utils/selectFiles.js");
3 3 var regeneratorRuntime = require('../../../utils/runtime.js');
4 4  
5 5 Page({
6   - data: {
7   - url: a.url,
8   - resourceUrl: a.resourceUrl,
9   - iurl: a.imghost,
10   - defaultPhoto: a.resourceUrl + "/static/images/camera.png",
11   - filePaths: [],
12   - uploadPath: [],
13   - maxWord: 0,
14   - is_anonymous: !1,
15   - goods_rank: 0,
16   - service_rank: 0,
17   - deliver_rank: 0,
18   - content: "",
19   - options: null,
20   - isLongPress: !1,
21   - userinfo:null,
22   - },
23   - onLoad:async function(a) {
24   - var th=this;
25   - console.log('onLoad');
26   - console.log(a);
  6 + data: {
  7 + url: a.url,
  8 + resourceUrl: a.resourceUrl,
  9 + iurl: a.imghost,
  10 + defaultPhoto: a.resourceUrl + "/static/images/camera.png",
27 11  
28   - await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+a.goods_id,{1:1}).then(res=>{
29   - a.img=th.data.iurl+res.data.data.original_img
30   - })
  12 + uploadPath: [], //上传后文件路径
  13 + maxWord: 0,
  14 + is_anonymous: !1,
  15 + goods_rank: 0,
  16 + service_rank: 0,
  17 + deliver_rank: 0,
  18 + content: "",
  19 + options: null,
  20 + isLongPress: !1,
  21 + userinfo: null,
  22 + imgs: [], //本地文件再上传时的路径
  23 + lenMore:0
  24 + },
  25 + onLoad: async function (a) {
  26 + var th = this;
  27 + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => {
31 28  
32   -
33   - this.setData({options: a});
34   - t.getUserInfo(function(e){
35   - console.log(e);
36   - th.setData({
37   - userinfo:e
38   - })
39   - })
40   - },
41   - keyUpChangeNum: function(t) {
42   - this.setData({
43   - maxWord: t.detail.value.length
44   - }), this.data.content = t.detail.value;
45   - },
46   - checkAnonymous: function() {
47   - this.setData({
48   - is_anonymous: !this.data.is_anonymous
49   - });
50   - },
51   - checkGoodsRank: function(t) {
52   - this.setData({
53   - goods_rank: parseInt(t.currentTarget.dataset.i) + 1
54   - });
55   - },
56   - checkServiceRank: function(t) {
57   - this.setData({
58   - service_rank: parseInt(t.currentTarget.dataset.i) + 1
  29 + a.img = th.data.iurl + res.data.data.pageData[0].original_img;
  30 + a.goods_name=res.data.data.pageData[0].goods_name;
  31 + a.goods_num=res.data.data.pageData[0].goods_num;
  32 + })
  33 + this.setData({ options: a });
  34 + t.getUserInfo(function (e) {
  35 + console.log(e);
  36 + th.setData({userinfo: e})
  37 + })
  38 + },
  39 + keyUpChangeNum: function (t) {
  40 + this.setData({
  41 + maxWord: t.detail.value.length
  42 + }), this.data.content = t.detail.value;
  43 + },
  44 + checkAnonymous: function () {
  45 + this.setData({
  46 + is_anonymous: !this.data.is_anonymous
  47 + });
  48 + },
  49 + checkGoodsRank: function (t) {
  50 + this.setData({
  51 + goods_rank: parseInt(t.currentTarget.dataset.i) + 1
  52 + });
  53 + },
  54 + checkServiceRank: function (t) {
  55 + this.setData({
  56 + service_rank: parseInt(t.currentTarget.dataset.i) + 1
  57 + });
  58 + },
  59 + checkDeliverRank: function (t) {
  60 + this.setData({
  61 + deliver_rank: parseInt(t.currentTarget.dataset.i) + 1
  62 + });
  63 + },
  64 + selectPhotos: function (t) {
  65 + if (this.data.isLongPress) this.data.isLongPress = !1; else {
  66 + var a = this;
  67 + i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function (t) {
  68 + a.setData({
  69 + filePaths: t
59 70 });
60   - },
61   - checkDeliverRank: function(t) {
62   - this.setData({
63   - deliver_rank: parseInt(t.currentTarget.dataset.i) + 1
64   - });
65   - },
66   - selectPhotos: function(t) {
67   - if (this.data.isLongPress) this.data.isLongPress = !1; else {
68   - var a = this;
69   - i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function(t) {
70   - a.setData({
71   - filePaths: t
72   - });
73   - });
  71 + });
  72 + }
  73 + },
  74 + removePhoto: function (t) {
  75 + var a = this;
  76 + this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function (t) {
  77 + a.setData({
  78 + filePaths: t
  79 + });
  80 + });
  81 + },
  82 + submitComment: function () {
  83 + var a = this;
  84 + if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank)
  85 + return getApp().my_warnning("请先打分",0,a);
  86 + if(a.data.content=="")
  87 + return getApp().my_warnning("请填写评价内容",0,a);
  88 +
  89 + //this.uploadPhotos(function () {
  90 + var p_data= {
  91 + email: ' ',
  92 + is_show: 1,
  93 + goods_rank: a.data.goods_rank,
  94 + service_rank: a.data.service_rank,
  95 + deliver_rank: a.data.deliver_rank,
  96 + content: a.data.content,
  97 + goods_id: a.data.options.goods_id,
  98 + order_id: a.data.options.order_id,
  99 + user_id: oo.user_id,
  100 + store_id: os.stoid,
  101 + username: a.data.userinfo.nickname,
  102 + source_type:1
  103 + }
  104 + if(a.data.uploadPath){
  105 + p_data['weapp_img']=JSON.stringify(a.data.uploadPath);
  106 + }
  107 + if(a.data.is_anonymous){
  108 + p_data['is_anonymous']=1;
  109 + }
  110 +
  111 + e.post("/api/weshop/comment/savecomment", {
  112 + data:p_data,
  113 + success: function (a) {
  114 + wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () {
  115 + wx.navigateBack();
  116 + });
74 117 }
75   - },
76   - removePhoto: function(t) {
77   - var a = this;
78   - this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function(t) {
79   - a.setData({
80   - filePaths: t
81   - });
82   - });
83   - },
84   - submitComment: function() {
85   - var a = this;
86   - if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) return t.showWarning("请先打完分~");
87   - this.uploadPhotos(function() {
88   - e.post("/api/weshop/comment/savecomment", {
89   - data: {
90   - email:' ',
91   - is_show:1,
92   - goods_rank: a.data.goods_rank,
93   - service_rank: a.data.service_rank,
94   - deliver_rank: a.data.deliver_rank,
95   - content: a.data.content,
96   - goods_id: a.data.options.goods_id,
97   - order_id: a.data.options.order_id,
98   - user_id: oo.user_id,
99   - store_id:os.stoid,
100   - username: a.data.userinfo.nickname
101   - },
102   - success: function(a) {
103   - wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function() {
104   - wx.navigateBack();
105   - });
106   - }
107   - });
108   - });
109   - },
110   - uploadPhotos: function(t, a) {
111   - if (0 == this.data.filePaths.length) return t();
112   - if ("number" != typeof a) a = 0; else if (a >= this.data.filePaths.length) return t();
113   - var s = this;
114   - e.uploadFile("/api/user/upload_comment_img", {
115   - filePath: s.data.filePaths[a],
116   - name: "img_file",
117   - success: function(e) {
118   - s.data.uploadPath[a] = e.data.result, s.uploadPhotos(t, a + 1);
119   - }
120   - });
121   - },
  118 + });
  119 + //});
  120 + },
  121 +
122 122  
123   - //图片失败,默认图片
124   - bind_bnerr2: function (e) {
  123 + uploadPhotos: function (t, a) {
  124 + if (0 == this.data.imgs.length) return t();
  125 + if ("number" != typeof a) a = 0; else if (a >= this.data.imgs.length) return t();
  126 + var s = this;
  127 + e.uploadFile("/api/weshop/comment/uploadCommentImg", {
  128 + filePath: s.data.imgs[a],
  129 + name: "file",
  130 + success: function (e) {
  131 + console.log("uploadPhotos");
  132 + console.log(e.data);
  133 + if(e.data.code==0)
  134 + s.data.uploadPath[a] = e.data.data, s.uploadPhotos(t, a + 1);
  135 + }
  136 + });
  137 + },
  138 +
  139 + //图片失败,默认图片
  140 + bind_bnerr2: function (e) {
125 141 var _errImg = e.target.dataset.errorimg;
126 142 var _errObj = {};
127   - _errObj[_errImg] = a.imghost+"/public/images/default_goods_image_240.gif";
  143 + _errObj[_errImg] = a.imghost + "/public/images/default_goods_image_240.gif";
128 144 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
129   - }
  145 + },
  146 + // 上传图片
  147 + chooseImg: function (e) {
  148 + var that = this;
  149 + var imgs = this.data.imgs;
  150 + if (imgs.length >= 3){
  151 + if(this.data.lenMore==0){
  152 + this.setData({ lenMore: 1 });
  153 + }
  154 + return false;
  155 + }
  156 +
  157 + var imgs = this.data.imgs;
  158 +
  159 + wx.chooseImage({
  160 + count: 1, // 默认9
  161 + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  162 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  163 + success: function (res) {
  164 + // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
  165 + var tempFilePaths = res.tempFilePaths;
  166 +
  167 + getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", {
  168 + filePath: tempFilePaths[0],
  169 + name: "file",
  170 + success: function (e) {
  171 + if(e.data.code==0) {
  172 + that.data.uploadPath.push(e.data.data);
  173 + imgs.push(tempFilePaths[0]);
  174 + that.setData({
  175 + imgs: imgs
  176 + });
  177 + }
  178 + }
  179 + });
  180 + }
  181 + });
  182 + },
  183 + // 删除图片
  184 + deleteImg: function (e) {
  185 + var imgs = this.data.imgs;
  186 + var index = e.currentTarget.dataset.index;
  187 + imgs.splice(index, 1);
  188 + this.setData({
  189 + imgs: imgs
  190 + });
  191 + },
  192 + // 预览图片
  193 + previewImg: function (e) {
  194 + //获取当前图片的下标
  195 + var index = e.currentTarget.dataset.index;
  196 + //所有图片
  197 + var imgs = this.data.imgs;
  198 + wx.previewImage({
  199 + //当前显示图片
  200 + current: imgs[index],
  201 + //所有图片
  202 + urls: imgs
  203 + })
  204 + },
  205 +
  206 + txtInpt:function (e) {
  207 + this.setData({
  208 + content: e.detail.value
  209 + })
  210 + },
  211 +
  212 + onUnload: function () {
  213 + wx.navigateBack({ delta:1 })
  214 + },
  215 +
  216 +
130 217 });
131 218 \ No newline at end of file
... ...
pages/user/add_comment/add_comment.json
1 1 {
2   - "navigationBarTitleText": "评价晒单",
3   - "enablePullDownRefresh": false
  2 + "navigationBarTitleText": "评价宝贝",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
4 7 }
5 8 \ No newline at end of file
... ...
pages/user/add_comment/add_comment.wxml
1   -<view class="goods-mes pd-bg-fff">
2   - <view class="goods-img">
3   - <image class="wh100" src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image>
4   - </view>
5   - <view class="goods-des">
6   - <view class="goods-name ellipsis-1">{{options.goods_name}}</view>
7   - <view class="goods-package ellipsis-1">¥{{options.price}}</view>
8   - </view>
9   -</view>
10   -<view class="evaluation">
11   - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="500" placeholder="写下购买体会和使用感受来帮助其他小伙伴吧~"></textarea>
12   - <view class="words-num">{{maxWord}}/500</view>
13   -</view>
  1 +<view class="commoditymax">
  2 + <!-- 商品评价 -->
  3 + <view class='commodity'>
  4 + <!-- 商品信息 -->
  5 + <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+options.goods_id}}">
  6 + <image src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image>
  7 + <view class="goods_name xc-black">
  8 + <!-- 商品名称 -->
  9 + <view class='ellipsis-2 fs32'>{{options.goods_name}}</view>
  10 + <!-- 商品价格,数量 -->
  11 + <view class='flex jc_sb balin'>
  12 + <!-- 价格 -->
  13 + <view class='flex-vertical balin'>
  14 + <view class="fs24">¥</view>
  15 + <view class="fs35">{{options.price}}</view>
  16 + </view>
  17 +
  18 + <!-- 商品数量 -->
  19 + <view class='sum flex-vertical balin xc-black'>
  20 + <view class="fs24">x</view>
  21 + <view class="fs28">{{options.goods_num}}</view>
  22 + </view>
  23 +
  24 + </view>
  25 +
  26 + </view>
  27 +
  28 + </navigator>
  29 +
  30 +
  31 + <!-- 商品评价信息 -->
  32 + <view class="addComment">
  33 + <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!" bindinput="txtInpt" placeholder-class="fs24" maxlength="500" value="{{content}}"></textarea>
  34 + <view class="flex addimages">
  35 + <!-- 评论图片集合 -->
  36 + <view class="images">
  37 + <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{item}}" wx:for="{{imgs}}">
  38 + <image class="abs" src="{{iurl}}miniapp/images/cancel.png" data-index="{{index}}" bindtap="deleteImg"></image>
  39 + </image>
  40 +
  41 + </view>
  42 +
  43 + <!-- 添加图片按钮框架 -->
  44 + <view class="addimage flex-center xc-ash" bindtap="chooseImg">
  45 + <view>
  46 + <view class="flex-center">
  47 + <image src="{{iurl}}miniapp/images/camera.png"></image>
  48 + </view>
  49 + <view class="flex-center fs20">添加图片</view>
  50 + <view class="flex-center fs20">{{imgs.length>0?imgs.length:0}}/3</view>
  51 + </view>
  52 + </view>
  53 +
  54 + </view>
14 55  
15   -<!------
16   -<view class="pic-list pd-bg-fff">
17   - <view class="share-pic" wx:for="{{5}}" wx:key="{{index}}">
18   - <image bindlongtap="removePhoto" bindtap="selectPhotos" class="wh100" data-idx="{{index}}" src="{{filePaths[index]?filePaths[index]:defaultPhoto}}"></image>
19 56 </view>
20   -</view>------->
21   -
22   -<!-- <view class="anonymous">
23   - <icon bindtap="checkAnonymous" color="{{is_anonymous?'red':'gray'}}" size="20" type="success"></icon> 匿名评价
24   -</view> -->
25   -<view class="score-list pd-bg-fff">
26   - <view class="score-title">
27   - <view>评分</view>
28   - <view>满意请给5分哦</view>
  57 + </view>
  58 +
  59 + <!-- 评价等级 -->
  60 + <view class="Grade">
  61 + <!-- 宝贝评分 -->
  62 + <view class="title flex-vertical">
  63 + <view class="column"></view>
  64 + <view class="fs28">宝贝评分</view>
29 65 </view>
30   - <view class="score-item">
31   - <view>商品符合度</view>
32   - <view class="stars">
33   - <image bindtap="checkGoodsRank" data-i="{{index}}" src="{{index<goods_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>
  66 +
  67 + <!-- 服务评级 -->
  68 + <view class="score-items">
  69 + <view class="score-item flex-vertical">
  70 + <view class="fs24">描述相符</view>
  71 + <view class="stars flex-vertical">
  72 + <view class="flex-vertical" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}" bindtap="checkGoodsRank">
  73 + <image src="{{index<goods_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  74 + </view>
34 75 </view>
35   - </view>
36   - <view class="score-item">
37   - <view>店家服务态度</view>
38   - <view class="stars">
39   - <image bindtap="checkServiceRank" data-i="{{index}}" src="{{index<service_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>
  76 + </view>
  77 +
  78 + <view class="score-item flex-vertical">
  79 + <view class="fs24">物流服务</view>
  80 + <view class="stars flex-vertical">
  81 + <view class="flex-vertical" bindtap="checkDeliverRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}">
  82 + <image src="{{index<deliver_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  83 + </view>
40 84 </view>
41   - </view>
42   - <view class="score-item">
43   - <view>物流发货速度</view>
44   - <view class="stars">
45   - <image bindtap="checkDeliverRank" data-i="{{index}}" src="{{index<deliver_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>
  85 + </view>
  86 + <view class="score-item flex-vertical">
  87 + <view class="fs24">服务态度</view>
  88 + <view class="stars flex-vertical">
  89 + <view class="flex-vertical" bindtap="checkServiceRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}">
  90 + <image src="{{index<service_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  91 + </view>
46 92 </view>
  93 +
  94 + </view>
  95 +
47 96 </view>
  97 +
  98 + </view>
48 99 </view>
49   -<view class="btn-wrap">
50   - <view bindtap="submitComment" class="submit-btn">提 交</view>
  100 +<!-- 是否匿名评价 -->
  101 +<view class=" Whether ">
  102 + <!-- 选择是否匿名 -->
  103 + <view class="allClick flex-right-vertical" bindtap="checkAnonymous">
  104 + <icon class="radio" size="15" type="success" color="{{is_anonymous?'red':'gainsboro'}}"></icon>
  105 + <view class="fs24 ">匿名评价</view>
  106 + </view>
  107 +
  108 + <view class="Submission flex-level ">
  109 + <view class="fs30 flex-level white " bindtap="submitComment">提交评价</view>
  110 + </view>
51 111 </view>
  112 +
  113 +
  114 +<warn id="warn"></warn>
52 115 \ No newline at end of file
... ...
pages/user/add_comment/add_comment.wxss
1   -.goods-mes {
2   - height: 100rpx;
3   - display: flex;
4   - padding: 30rpx;
5   - justify-content: space-between;
  1 +page{
  2 + overflow-x: hidden;
  3 +}
  4 +/* 商品详情和评价 */
  5 +.commoditymax{
  6 + overflow-x: hidden;
  7 +}
  8 +.commodity {
  9 + height: 715rpx;
  10 + border-top: 6rpx solid rgb(245, 245, 245);
  11 + border-bottom: 6rpx solid rgb(245, 245, 245);
  12 + padding: 0rpx 30rpx;
  13 +}
  14 +
  15 +.commodity .information {
  16 + height: 286rpx;
  17 +}
  18 +
  19 +.commodity .information image {
  20 + width: 186rpx;
  21 + height: 186rpx;
  22 +}
  23 +
  24 +.information .goods_name {
  25 + width: 480rpx;
  26 + margin-left: 25rpx;
  27 + height: 186rpx;
  28 +}
  29 +
  30 +.information .goods_name .ellipsis-2 {
  31 + line-height: 40rpx;
  32 + height: 80rpx;
6 33 }
7 34  
8   -.goods-img {
9   - width: 100rpx;
10   - height: 100rpx;
11   - overflow: hidden;
  35 +.information .goods_name .jc_sb {
  36 + margin-top: 60rpx;
  37 + color: rgb(212, 28, 52);
  38 + margin-right: 7rpx;
12 39 }
13 40  
14   -.goods-des {
15   - width: 560rpx;
  41 +.information .goods_name .jc_sb .fs32 {
  42 + line-height: 40rpx;
16 43 }
17 44  
18   -.goods-des>view {
19   - width: 100%;
20   - height: 32rpx;
21   - line-height: 1;
22   - font-size: 32rpx;
23   - color: #444;
  45 +.information .goods_name .jc_sb .sum {
  46 + margin-right: 5rpx;
24 47 }
25 48  
26   -.goods-package {
27   - margin-top: 36rpx;
  49 +.balin {
  50 + align-items: baseline;
28 51 }
29 52  
30   -.evaluation {
31   - padding: 30rpx 30rpx;
32   - position: relative;
33   - font-size: 28rpx;
  53 +.addComment {
  54 + height: 345rpx;
  55 + width: 690rpx;
  56 + background-color: rgb(248, 248, 248);
  57 + padding: 32rpx 0rpx 21rpx 0rpx;
34 58 }
35 59  
36   -.word-box {
37   - color: #444;
38   - line-height: 40rpx;
39   - width: 100%;
40   - height: 200rpx;
  60 +.addComment textarea {
  61 + padding: 0rpx 18rpx;
  62 + height: 175rpx;
  63 + width: 654rpx;
41 64 }
42 65  
43   -.words-num {
44   - position: absolute;
45   - right: 30rpx;
46   - bottom: 30rpx;
47   - color: #777;
  66 +.addComment .addimages {
  67 + padding: 0rpx 18rpx;
  68 + margin-top: 20rpx;
  69 + align-items: flex-end;
  70 + width: 652rpx;
48 71 }
49 72  
50   -.pic-list {
51   - padding: 40rpx 20rpx 20rpx;
52   - display: flex;
53   - justify-content: space-around;
  73 +.addComment .addimages .images {
  74 + height: 140rpx;
54 75 }
55 76  
56   -.share-pic {
57   - width: 126rpx;
58   - height: 126rpx;
59   - border: 1px solid #ddd;
60   - overflow: hidden;
  77 +.addComment .addimages .images .rel {
  78 + width: 140rpx;
  79 + height: 100%;
  80 + overflow: visible;
  81 + margin-right: 15rpx;
61 82 }
62 83  
63   -.anonymous {
64   - height: 60rpx;
65   - padding: 0 20rpx 20rpx;
66   - background-color: #fff;
67   - display: flex;
68   - align-items: center;
69   - font-size: 30rpx;
70   - color: #777;
  84 +.addComment .addimages .images image .abs {
  85 + width: 30rpx;
  86 + height: 30rpx;
  87 + top: -7rpx;
  88 + right: -7rpx;
71 89 }
72 90  
73   -.anonymous>icon {
74   - margin-right: 20rpx;
  91 +.addComment .addimage {
  92 + width: 139rpx;
  93 + height: 139rpx;
  94 + border: 2rpx dashed rgb(196, 196, 196);
  95 + font-size: 16rpx;
  96 + margin-left: 6rpx;
75 97 }
76 98  
77   -.score-list {
78   - margin-top: 20rpx;
  99 +.addComment .addimage image {
  100 + width: 60rpx;
  101 + height: 58rpx;
79 102 }
80 103  
81   -.score-list>view {
82   - display: flex;
83   - justify-content: space-between;
84   - font-size: 30rpx;
85   - color: #444;
  104 +.Grade {
  105 + width: 100%;
  106 + height: 310rpx;
  107 + border-bottom: 6rpx solid rgb(245, 245, 245);
  108 + padding-left: 45rpx;
86 109 }
87 110  
88   -.score-title {
89   - height: 90rpx;
90   - line-height: 90rpx;
91   - border-bottom: 1px solid #eee;
  111 +.Grade .title {
  112 + width: 100%;
  113 + height: 105rpx;
92 114 }
93 115  
94   -.score-item {
95   - align-items: center;
96   - height: 80rpx;
  116 +.Grade .title .column {
  117 + height: 30rpx;
  118 + border-left: 6rpx solid rgb(211, 27, 58);
  119 + margin-right: 12rpx;
97 120 }
98 121  
99   -.stars {
100   - display: flex;
  122 +.Grade .score-item {
  123 + height: 55rpx;
  124 + line-height: 55rpx;
101 125 }
102 126  
103   -.stars image {
104   - width: 44rpx;
105   - height: 40rpx;
  127 +.Grade .score-item .stars {
  128 + margin-left: 83rpx;
  129 +}
  130 +.Grade .score-item .stars view{
  131 + width: 60rpx;
  132 + height: 55rpx;
  133 +}
  134 +
  135 +.Grade .score-item .stars image {
  136 + width: 35rpx;
  137 + height: 35rpx;
  138 +}
  139 +.Whether {
  140 + padding:0rpx 31rpx;
  141 +}
  142 +.Whether .flex-right-vertical {
  143 + height: 67rpx;
106 144 }
107 145  
108   -.btn-wrap {
109   - padding: 20rpx 0;
110   - background-color: #fff;
111   - border-top: 1px solid #eee;
  146 +.Whether .flex-right-vertical .radio {
  147 + margin-right: 15rpx;
112 148 }
113 149  
114   -.submit-btn {
115   - width: 320rpx;
116   - height: 80rpx;
117   - line-height: 80rpx;
118   - text-align: center;
119   - background-color: #f15353;
120   - color: #fff;
121   - margin: auto;
122   -}
123 150 \ No newline at end of file
  151 +.Whether .Submission {
  152 + margin: 40rpx 0 40rpx 0;
  153 +}
  154 +
  155 +.Whether .white {
  156 + width: 364rpx;
  157 + height: 58rpx;
  158 + background-color: rgb(212, 28, 52);
  159 + border-radius: 40rpx;
  160 + line-height: 58rpx;
  161 +}
  162 +
  163 +
... ...
pages/user/collect_list/collect_list.js
1 1 var t = function(t) {
2 2 return t && t.__esModule ? t : {
3   - default: t
  3 + default: t
4 4 };
5   -}(require("../../../utils/LoadMore.js")), e = getApp(), a = e.request, o = new t.default();
6   -var oo = e.globalData.setting, app_d = e.globalData;
  5 + }(require("../../../utils/LoadMore.js")),
  6 + e = getApp(),
  7 + a = e.request,
  8 + o = new t.default();
  9 +var oo = e.globalData.setting,
  10 + app_d = e.globalData;
7 11  
8 12 Page({
9   - data: {
10   - url: e.globalData.setting.imghost,
11   - resourceUrl: e.globalData.setting.resourceUrl,
12   - iurl: e.globalData.setting.imghost,
13   - collects: null,
14   - currentPage: 1
15   - },
16   - onLoad: function() {
17   - o.init(this, "", "collects"), this.requestCollectList();
18   - },
19   - requestCollectList: function() {
20   - var t = this, e = "/api/weshop/goodscollect/list?pageSize=10&user_id="
21   - +app_d.user_id+"&store_id=" + oo.stoid+"&page=" + t.data.currentPage;
22   - o.request(e, function(e) {
23   - console.log("requestCollectList");
24   - console.log(e);
25   - t.data.currentPage++;
26   - });
27   - },
28   - onReachBottom: function() {
29   - o.canloadMore() && this.requestCollectList();
30   - },
31   - cancelCollect: function(t) {
32   - var e = t.currentTarget.dataset.id, o = this;
33   - a.delete("/api/weshop/goodscollect/del/" + oo.stoid+"/"+e, {
34   - success: function(t) {
35   - o.deleteItemData(e);
36   - }
  13 + data: {
  14 + url: e.globalData.setting.imghost,
  15 + resourceUrl: e.globalData.setting.resourceUrl,
  16 + iurl: e.globalData.setting.imghost,
  17 + collects: null,
  18 + currentPage: 1,
  19 + curpage: 1,
  20 + ismore: 0,
  21 + iscollects: 0,
  22 + editEd: 0, //商品编辑按钮是否点击
  23 + isall: false, //是否全选
  24 + sum: 0,
  25 + total_collects: 0,
  26 + is_goods: 0,
  27 + pageSize: 8, //分页数量
  28 + isdelete: 0
  29 + },
  30 + onLoad: function() {
  31 + o.init(this, "", "collects"),
  32 + this.requestCollectList();
  33 + },
  34 + requestCollectList: function() {
  35 + var th = this;
  36 + e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize + "&user_id=" +
  37 + app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage;
  38 + o.request(e, function(e) {
  39 + th.data.currentPage++;
  40 + if (th.data.total_collects == 0) {
  41 + th.setData({
  42 + iscollects: 1,
  43 + total_collects: e.data.data.total
  44 + })
  45 + }
  46 + if (th.data.total_collects < th.data.pageSize) {
  47 +
  48 + th.setData({
  49 + is_goods: 1
  50 + })
  51 + var goods_list = th.selectComponent("#goods_recommend"); //组件的id
  52 + goods_list.get_list();
  53 +
  54 +
  55 + }
  56 + });
  57 + },
  58 +
  59 + //--到底部刷新---
  60 + onReachBottom: function() {
  61 + if ((this.data.currentPage - 1) * this.data.pageSize < this.data.total_collects) {
  62 + this.requestCollectList();
  63 + } else {
  64 + if (this.data.is_goods == 0) this.setData({
  65 + is_goods: 1
  66 + });
  67 + var goods_list = this.selectComponent("#goods_recommend"); //组件的id
  68 + goods_list.get_list();
  69 + }
  70 +
  71 + },
  72 +
  73 + //--取消收藏---
  74 + cancelCollect: function(t) {
  75 + var e = t.currentTarget.dataset.id,
  76 + o = this;
  77 + a.delete("/api/weshop/goodscollect/del/" + oo.stoid + "/" + e, {
  78 + success: function(t) {
  79 + o.deleteItemData(e);
  80 + }
  81 + });
  82 + },
  83 + deleteItemData: function(t) {
  84 + for (var e = 0; e < this.data.collects.length; e++)
  85 + if (this.data.collects[e].collect_id == t) {
  86 + this.data.collects.splice(e, 1), this.setData({
  87 + collects: this.data.collects
37 88 });
38   - },
39   - deleteItemData: function(t) {
40   - for (var e = 0; e < this.data.collects.length; e++) if (this.data.collects[e].collect_id== t) {
41   - this.data.collects.splice(e, 1), this.setData({
42   - collects: this.data.collects
43   - });
44   - break;
  89 + break;
  90 + }
  91 + },
  92 + //图片失败,默认图片
  93 + bind_bnerr: function(e) {
  94 + var _errImg = e.currentTarget.dataset.errimg;
  95 + var _errObj = {};
  96 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  97 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  98 +
  99 + },
  100 +
  101 + requestList: function() {
  102 +
  103 + var e = this;
  104 + a.get("/api/weshop/goods/page", {
  105 + isShowLoading: 0,
  106 + data: {
  107 + store_id: 1,
  108 + user_id: oo.user_id,
  109 + page: e.data.curpage,
  110 + pageSize: 10
  111 + },
  112 + success: function(t) {
  113 + e.data.curpage++;
  114 + var arr1 = e.data.collects_Recommend;
  115 + var arr2 = t.data.data.pageData;
  116 + var arr3 = [...arr1, ...arr2];
  117 +
  118 + var ismore = 0;
  119 + if (arr3.length == t.data.data.total) ismore = 1
  120 +
  121 + e.setData({
  122 + collects_Recommend: arr3,
  123 + total_goods: t.data.data.total,
  124 + ismore_goods: ismore,
  125 + loadName: null
  126 + }), wx.stopPullDownRefresh();
  127 + }
  128 + });
  129 + },
  130 +
  131 +
  132 + goto: function(ee) {
  133 + wx.switchTab({
  134 + url: '/pages/index/index/index',
  135 + })
  136 + },
  137 + //编辑商品显示
  138 + editcollects: function() {
  139 + var th = this.data;
  140 + var t = this;
  141 + if (th.editEd == 0) {
  142 + t.select_checked(false, null)
  143 + t.setData({
  144 + editEd: 1,
  145 + isall:0
  146 + })
  147 + } else {
  148 + t.select_checked(false, null)
  149 + t.setData({
  150 + editEd: 0
  151 + })
  152 + }
  153 + },
  154 + iconClick: function(e) {
  155 + var th = this.data;
  156 + var index = e.currentTarget.dataset.index;
  157 + var collect = "collects[" + index + "].checked";
  158 + if (this.data.collects[index].checked == true) {
  159 + this.setData({
  160 + [collect]: false,
  161 + isall: 0,
  162 + sum: --th.sum
  163 + })
  164 + } else {
  165 + var id = th.collects[index].collect_id;
  166 + this.setData({
  167 + [collect]: true,
  168 + sum: ++th.sum
  169 + })
  170 + if (th.sum == th.collects.length) {
  171 + this.setData({
  172 + isall: 1
  173 + })
  174 + }
  175 + }
  176 + },
  177 + //全选为收藏商品checked为true
  178 + allClick: function() {
  179 + var th = this;
  180 + var list = th.data.collects;
  181 + //判断是否全选
  182 + if (th.data.isall) {
  183 + for (var i = 0; i < list.length; i++) {
  184 + list[i].checked = false;
  185 + }
  186 + this.setData({
  187 + sum: 0,
  188 + isall: 0,
  189 + collects: list
  190 + })
  191 + } else {
  192 + for (var i = 0; i < list.length; i++) {
  193 + list[i].checked = true;
  194 + }
  195 + this.setData({
  196 + sum: th.data.collects.length,
  197 + collects: list,
  198 + isall: 1
  199 + })
  200 + }
  201 + },
  202 +
  203 + //分页删除
  204 + alldelete: function(e) {
  205 +
  206 + var th = this;
  207 + if (th.data.isdelete) return false;
  208 + // 全选的话直接删除
  209 + if (th.data.isall) {
  210 + a.delete("/api/weshop/goodscollect/removeUser/" + oo.stoid + "/" + app_d.user_id, {
  211 + isShowLoading: 0,
  212 + success: function(e) {
  213 + th.setData({
  214 + collects: [],
  215 + total_collects: 0,
  216 + isdelete:0
  217 + })
  218 + getApp().my_warnning("取消成功", 1, th);
  219 +
45 220 }
46   - },
47   -
48   - //图片失败,默认图片
49   - bind_bnerr2: function (e) {
50   - var _errImg = e.target.dataset.errorimg;
51   - var th=this;
52   - this.setData({
53   - [_errImg]: th.data.iurl+"/miniapp/images/default_g_img.gif",
  221 + })
  222 + } else { //按照多个id删除收藏商品
  223 +
  224 + var new_colls = [];
  225 + var collectId = th.data.collects;
  226 +
  227 + var str = "";
  228 + for (var i = 0; i < th.data.collects.length; i++) {
  229 + if (collectId[i].checked) {
  230 + str += collectId[i].collect_id + ",";
  231 + } else {
  232 + new_colls.push(collectId[i]);
  233 + }
  234 + }
  235 + if(str.length==""){
  236 + getApp().my_warnning("请选择商品", 0, th);
  237 + return false;
  238 + }
  239 + th.setData({
  240 + isdelete: 1
  241 + })
  242 + str = str.substr(0, str.length - 1);
  243 + var url = "/api/weshop/goodscollect/removeByIds/" + oo.stoid + "/" + app_d.user_id + "/" + str;
  244 +
  245 + a.delete(url, {
  246 + isShowLoading: 0,
  247 + success: function(e) {
  248 + th.setData({
  249 + collects: new_colls,
  250 + sum: 0,
  251 + total_collects: new_colls.length,
  252 + isdelete: 0
54 253 })
  254 + // th.select_checked(false,null);
  255 + getApp().my_warnning("取消收藏成功", 1, th);
  256 + }
  257 +
  258 + })
  259 +
  260 + }
  261 + },
  262 + select_checked: function(check, sum) {
  263 + var th = this;
  264 + if (sum == null) {
  265 + for (var i = 0; i < this.data.collects.length; i++) {
  266 + var collect = "collects[" + i + "].checked";
  267 + th.setData({
  268 + [collect]: check,
  269 + sum:0
  270 + })
  271 + }
  272 + } else {
  273 + var collect = "collects[" + sum + "].checked";
  274 + th.setData({
  275 + [collect]: check
  276 + })
55 277 }
  278 + },
  279 +
  280 + go_to: function(e) {
  281 + var th = this;
  282 + var url = e.currentTarget.dataset.url;
  283 + getApp().goto(url);
  284 + }
56 285 });
57 286 \ No newline at end of file
... ...
pages/user/collect_list/collect_list.json
1 1 {
2 2 "navigationBarTitleText": "我的收藏",
3   - "enablePullDownRefresh": false
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn",
  6 + "goods_recommend": "/components/goods_list/goods_list"
  7 + }
4 8 }
5 9 \ No newline at end of file
... ...
pages/user/collect_list/collect_list.wxml
1   -<view class="container">
2   - <view class="collect-ul">
3   - <view class="collect-li" wx:for="{{collects}}" wx:key="{{index}}">
4   - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
5   - <image class="collect-img" src="{{item.original_img}}" lazy-load="true"
6   - binderror="bind_bnerr2" data-errorimg="collects[{{index}}].original_img"></image>
7   - </navigator>
8   - <view class="collect-name ellipsis-2">{{item.goods_name}}</view>
9   - <view class="collect-footer">
10   - <view class="collect-price">¥{{item.shop_price}}</view>
11   - <view bindtap="cancelCollect" class="collect-btn" data-id="{{item.collect_id}}">删除</view>
12   - <navigator class="collect-btn" url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}">看相似</navigator>
  1 +<!-- 无收藏时显示 -->
  2 +<view class="noCollection" wx:if="{{iscollects==0?false:true && collects.length<1}}">
  3 + <view class="flex-level">
  4 + <image src="{{url}}miniapp/images/Nocollection.png"></image>
  5 + </view>
  6 + <view class="flex-level fs30 xc-ash">当前暂无收藏</view>
  7 + <view class="flex-level">
  8 + <navigator url="/pages/index/index/index" bindtap="goto">
  9 + <view class="flex-center fs28 white">去首页逛逛</view>
  10 + </navigator>
  11 + </view>
  12 +</view>
  13 +
  14 +<view class="Collection" wx:if="{{collects.length>0}}">
  15 + <!-- 收藏商品 -->
  16 + <view class="commodity">
  17 + <!-- 商品数量 -->
  18 + <view class="sum flex-vertical-between fs24">
  19 + <view class="flex-center ">共{{total_collects}}件商品</view>
  20 + <view class="flex-right-vertical editEd" bindtap="editcollects">{{editEd==1?'完成':'编辑'}}</view>
  21 + </view>
  22 + <!-- 商品集合 -->
  23 + <view class="{{editEd?'collects_max colls_max':'collects_max'}}">
  24 + <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}" url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}">
  25 +
  26 + <view class="radioCheck iconClick" wx:if="{{editEd}}">
  27 + <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio>
  28 + </view>
  29 + <!-- 商品图片 -->
  30 + <view class="flex">
  31 + <view class="{{editEd?'collect_image iconrp':'collect_image'}}">
  32 + <image src="{{item.original_img}}" binderror="bind_bnerr" data-errimg="collects[{{index}}].original_img"></image>
  33 + </view>
  34 +
  35 + <!-- 商品属性 -->
  36 + <view class="attribute">
  37 +
  38 + <view class="attribute_name ellipsis-2">
  39 + <view class="name fs32">{{item.goods_name}}</view>
  40 + </view>
  41 +
  42 + <!-- 商品价格 -->
  43 + <view class="attribute_money flex-vertical line">
  44 + <view class="money_left flex-vertical line">
  45 + <!-- 优惠价 -->
  46 + <view class="price flex xc-wc">
  47 + <view class="fs24">¥</view>
  48 + <view class="fs40">{{item.shop_price}}</view>
  49 + </view>
  50 + <!-- 原价 -->
  51 + <view class="flex fs24 line through xc-ash">
  52 + <view>零售价:</view>
  53 + <view>¥{{item.market_price}}</view>
  54 + </view>
  55 + </view>
  56 +
  57 + <view class="money_right flex line" wx:if="{{!editEd}}">
  58 + <view class="similar flex-level fs22" catchtap="go_to" data-url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}">
  59 + <view>找相似</view>
  60 + </view>
  61 + <image src="{{url}}miniapp/images/trash.png" catchtap="cancelCollect" data-id="{{item.collect_id}}"></image>
  62 + </view>
  63 +
13 64 </view>
  65 +
  66 + </view>
  67 +
14 68 </view>
  69 +
  70 + </navigator>
  71 +
  72 + </view>
  73 +</view>
  74 +
  75 +<!--- 好物推荐 --->
  76 +<view class="title" wx:if="{{collects.length>0 && is_goods}}">
  77 + <view class="Recommend flex-center">
  78 + <view class="lin"></view>
  79 + <view class="flex-center">
  80 + <image src="{{url}}miniapp/images/Diamonds.png"></image>
  81 + <view class="fs28">好物推荐</view>
  82 + </view>
  83 + <view class="lin"></view>
  84 + </view>
  85 + <!-- 好物推荐 -->
  86 + <goods_recommend id="goods_recommend"></goods_recommend>
  87 +</view>
  88 +</view>
  89 +
  90 +<!-- 全选收藏 -->
  91 +<view class="abs flex-vertical" wx:if="{{editEd && collects.length>0}}">
  92 + <view class="left">
  93 + <!-- 全选收藏按钮 -->
  94 + <view class="flex-vertical fs32" bindtap="allClick">
  95 + <radio class="iconUn" color="rgb(214,1,33)" checked="{{isall}}"></radio>
  96 + <view>全选</view>
15 97 </view>
16   - <view class="no-data" wx:if="{{!collects||collects.length==0}}">
17   - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
18   - <view class="no-data-title">没有相关的数据</view>
19   - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator>
  98 +
  99 + <view class="Number flex-vertical">
  100 + 已选
  101 + <view class="co-red goods_num">{{sum>0?sum:'0'}}</view> 件
20 102 </view>
  103 + </view>
  104 + <view class="delete fs30 flex-center white {{isdelete==1?'Deleting':''}}" bindtap="alldelete">
  105 + {{isdelete==0?'删除':'删除中'}}
  106 + </view>
21 107 </view>
  108 +
  109 +<warn id="warn"></warn>
22 110 \ No newline at end of file
... ...
pages/user/collect_list/collect_list.wxss
1   -.collect-ul {
  1 +/* .collect-ul {
2 2 width: 100%;
3 3 background-color: #f0f2f5;
4 4 }
... ... @@ -46,4 +46,475 @@
46 46 border-radius: 5rpx;
47 47 color: #686868;
48 48 font-size: 30rpx;
  49 +} */
  50 +
  51 +page {
  52 + width: 100%;
  53 + background-color: rgb(245, 245, 245);
  54 + overflow-x: hidden;
  55 +}
  56 +
  57 +.Collection {
  58 + overflow-x: hidden;
  59 +}
  60 +
  61 +/* vip开卡框架 */
  62 +
  63 +.vip {
  64 + width: 100%;
  65 + height: 70rpx;
  66 + background-color: rgb(250, 242, 219);
  67 + font-size: 25rpx;
  68 + padding: 0rpx 31rpx;
  69 +}
  70 +
  71 +.vip .vip_image {
  72 + width: 40rpx;
  73 + height: 40rpx;
  74 + background-color: rgb(55, 45, 13);
  75 + border-radius: 50%;
  76 + line-height: 70rpx;
  77 +}
  78 +
  79 +.vip .vip_image image {
  80 + width: 25rpx;
  81 + height: 25rpx;
  82 + line-height: 70rpx;
  83 +}
  84 +
  85 +.vip .vip_describe {
  86 + width: 502prx;
  87 + margin-left: 20rpx;
  88 + padding-right: 172rpx;
  89 + line-height: 70rpx;
  90 + border-right: 4rpx solid #000;
  91 + height: 25rpx;
  92 +}
  93 +
  94 +.vip .vip_describe .vip_province_money {
  95 + color: rgb(254, 0, 0);
  96 +}
  97 +
  98 +.vip .vip_card {
  99 + margin-left: 17rpx;
  100 + line-height: 70rpx;
  101 +}
  102 +
  103 +.vip .vip_card .vip_go_image {
  104 + margin-left: 10rpx;
  105 +}
  106 +
  107 +.vip .vip_card .vip_immediately {
  108 + color: rgb(56, 47, 14);
  109 +}
  110 +
  111 +.vip .vip_card .vip_go_image image {
  112 + width: 35rpx;
  113 + height: 35rpx;
  114 +}
  115 +
  116 +.commodity {
  117 + width: 100%;
  118 +}
  119 +
  120 +/* 无收藏样式 */
  121 +
  122 +.noCollection image {
  123 + width: 329rpx;
  124 + height: 229rpx;
  125 + margin-top: 202rpx;
  126 +}
  127 +
  128 +.noCollection .xc-ash {
  129 + margin-top: 41rpx;
  130 + font-weight: 600px;
  131 +}
  132 +
  133 +.noCollection navigator {
  134 + margin-top: 73rpx;
  135 + border-radius: 40rpx;
  136 +}
  137 +
  138 +.noCollection navigator view {
  139 + width: 247rpx;
  140 + height: 56rpx;
  141 + background-color: rgb(255, 72, 72);
  142 + border-radius: 40rpx;
  143 +}
  144 +
  145 +/* 商品详情 */
  146 +
  147 +.commodity .sum {
  148 + font-size: 28rpx;
  149 + height: 70rpx;
  150 + background-color: rgb(245, 245, 245);
  151 + padding-left: 31rpx;
  152 + color: rgb(131, 131, 131);
  153 +}
  154 +
  155 +.commodity .sum view {
  156 + height: 100%;
  157 + letter-spacing: 1rpx;
  158 +}
  159 +
  160 +.commodity .sum .editEd {
  161 + width: 100rpx;
  162 + padding-right: 31rpx;
  163 +}
  164 +
  165 +.colls_max {
  166 + padding-left: 30rpx;
  167 +}
  168 +
  169 +.commodity .collects_max .collect {
  170 + width: 100%;
  171 + height: 244rpx;
  172 + border-bottom: 4rpx solid rgb(245, 245, 245);
  173 + background-color: rgb(255, 255, 255);
  174 + padding-right: 31rpx;
  175 +}
  176 +
  177 +.commodity .collects_max .collect .collect_image {
  178 + height: 183rpx;
  179 + width: 183rpx;
  180 + margin-left: 31rpx;
  181 +}
  182 +
  183 +.commodity .collects_max .collect .iconrp {
  184 + margin-left: 0rpx;
  185 +}
  186 +
  187 +.commodity .collects_max .collect .collect_image image {
  188 + width: 100%;
  189 + height: 100%;
  190 +}
  191 +
  192 +.commodity .collects_max .collect .attribute {
  193 + line-height: 68rpx;
  194 + height: 183rpx;
  195 + margin-left: 21rpx;
  196 +}
  197 +
  198 +.commodity .collects_max .collect .attribute .attribute_name {
  199 + height: 68rpx;
  200 + align-items: center;
  201 + width: 474rpx;
  202 +}
  203 +
  204 +.commodity .collects_max .collect .attribute .attribute_name .name {
  205 + line-height: 35rpx;
  206 +}
  207 +
  208 +.commodity .collects_max .collect .attribute .attribute_money {
  209 + margin-top: 60rpx;
  210 + display: flex;
  211 + justify-content: space-between;
  212 + height: 50rpx;
  213 + align-items: flex-end;
  214 +}
  215 +
  216 +.commodity .collects_max .money_left {
  217 + height: 54rpx;
  218 +}
  219 +
  220 +.commodity .collects_max .collect .attribute .attribute_money .money_left .price {
  221 + font-weight: 1000rpx;
  222 + color: rgb(212, 28, 52);
  223 + margin-right: 10rpx;
  224 + align-items: baseline;
  225 +}
  226 +
  227 +.commodity .collects_max .collect .attribute .attribute_money .money_right {
  228 + align-items: flex-end;
  229 + padding-bottom: 1rpx;
  230 +}
  231 +
  232 +.commodity .collects_max .collect .attribute .attribute_money .money_right .similar {
  233 + width: 97rpx;
  234 + height: 35rpx;
  235 + border-radius: 21rpx;
  236 + border: 1rpx solid rgb(162, 162, 162);
  237 + margin-right: 22rpx;
  238 + color: rgb(110,110, 110);
  239 + align-items: center;
  240 +}
  241 +
  242 +.commodity .collects_max .collect .attribute .attribute_money .money_right view {
  243 + height: 30rpx;
  244 + line-height: 30rpx;
  245 +}
  246 +
  247 +.commodity .collects_max .collect .attribute .attribute_money .money_right image {
  248 + width: 35rpx;
  249 + height: 35rpx;
  250 + margin-right: 10rpx;
  251 + margin-bottom: 1rpx;
  252 +}
  253 +
  254 +.line {
  255 + align-items: baseline;
  256 +}
  257 +
  258 +.title .collect {
  259 + background-color: rgb(255, 255, 255);
  260 +}
  261 +
  262 +/* 热门好物 */
  263 +
  264 +/* .title .China {
  265 + width: 100%;
  266 + margin-top: 50rpx;
  267 + margin-bottom: 10rpx;
  268 + line-height: 0rpx;
  269 +}
  270 +
  271 +.title .China .lin view {
  272 + width: 2rpx;
  273 +}
  274 +
  275 +.title .China .le {
  276 + height: 40rpx;
  277 + color: rgb(51,51, 51);
  278 +}
  279 +
  280 +.title .China .line .one {
  281 + height: 23rpx;
  282 + background-color: #000;
  283 + margin-left: 5rpx;
  284 +}
  285 +
  286 +.title .China .line .two {
  287 + height: 15rpx;
  288 + background-color: #000;
  289 + margin-left: 5rpx;
  290 +}
  291 +
  292 +.title .China .line .three {
  293 + height: 18rpx;
  294 + background-color: #000;
  295 + margin-left: 5rpx;
  296 +}
  297 +
  298 +.title .China .Recommend {
  299 + margin: 0rpx 20rpx;
  300 + font-size: 28rpx;
  301 + line-height: 39rpx;
  302 + font-weight: bold;
  303 +}
  304 +
  305 +.title .english .silk {
  306 + width: 214rpx;
  307 + height: 2rpx;
  308 + background-color: #000;
  309 +}
  310 +
  311 +.title .english .esh {
  312 + margin: 0rpx 15rpx;
  313 +} */
  314 +
  315 +/* .collects {
  316 + margin-top: 40rpx;
  317 +} */
  318 +
  319 +.Recommend {
  320 + height: 80rpx;
  321 + padding-top: 7rpx;
  322 +}
  323 +
  324 +.Recommend .lin {
  325 + width: 210rpx;
  326 + height: 2rpx;
  327 + background-color: rgb(167, 167, 167);
  328 +}
  329 +
  330 +.Recommend .flex-center {
  331 + margin: 0 20rpx;
  332 + color: rgb(51, 51, 51);
  333 + font-weight: bold;
  334 +}
  335 +
  336 +.Recommend .flex-center image {
  337 + margin-right: 5rpx;
  338 + width: 32rpx;
  339 + height: 29rpx;
  340 +}
  341 +
  342 +.hang {
  343 + width: 100%;
  344 + margin: auto;
  345 + padding-left: 31rpx;
  346 +}
  347 +
  348 +.hang .collect {
  349 + width: 335rpx;
  350 + height: 503rpx;
  351 + border-radius: 23rpx;
  352 + border: 1rpx solid rgb(214, 214, 214);
  353 + overflow: hidden;
  354 + margin-right: 14rpx;
  355 + margin-bottom: 10rpx;
  356 +}
  357 +
  358 +.collect .bottom {
  359 + padding: 0rpx 16rpx;
  360 +}
  361 +
  362 +.collect .bottom .goods_name {
  363 + height: 68rpx;
  364 +}
  365 +
  366 +.collect .sp {
  367 + width: 100%;
  368 + height: 315rpx;
  369 +}
  370 +
  371 +.collect .money {
  372 + margin-top: 40rpx;
  373 + line-height: 28rpx;
  374 + align-items: baseline;
  375 +}
  376 +
  377 +.collect .money view {
  378 + display: flex;
  379 + align-items: baseline;
  380 + font-weight: 1000rpx;
  381 +}
  382 +
  383 +.collect .Discount {
  384 + width: 156rpx;
  385 + height: 28rpx;
  386 + border-radius: 20rpx;
  387 + background-color: rgb(56, 56, 56);
  388 + font-size: 18rpx;
  389 + color: rgb(255, 255, 255);
  390 +}
  391 +
  392 +.collect .Discount image {
  393 + height: 18rpx;
  394 + width: 18rpx;
  395 + line-height: 28rpx;
  396 + margin-right: 3rpx;
  397 +}
  398 +
  399 +.collect.ml20 {
  400 + margin-left: 13rpx;
  401 +}
  402 +
  403 +.fs24.dollar {
  404 + padding: 0rpx;
  405 +}
  406 +
  407 +.through {
  408 + text-decoration: line-through;
  409 + color: rgb(155, 155, 155);
  410 + margin-left: 7rpx;
  411 +}
  412 +
  413 +.money .price {
  414 + margin-left: 12rpx;
  415 + text-decoration: line-through;
  416 +}
  417 +
  418 +.money .price view {
  419 + display: flex;
  420 + align-items: flex-end;
  421 +}
  422 +
  423 +.province {
  424 + line-height: 28rpx;
  425 +}
  426 +
  427 +.nothing {
  428 + height: 75rpx;
  429 + width: 100%;
  430 +}
  431 +
  432 +.nothing .no_content {
  433 + margin: 0rpx 11rpx;
  434 + color: rgb(138, 138, 138);
  435 +}
  436 +
  437 +.nothing .Foil {
  438 + width: 80rpx;
  439 + height: 2rpx;
  440 + background-color: rgb(138, 138, 138);
  441 +}
  442 +
  443 +.iconUn {
  444 + margin-left: 15rpx;
  445 + margin-right: 21rpx;
  446 + transform: scale(1.0);
  447 +}
  448 +
  449 +.Un {
  450 + margin-left: 0rpx;
  451 +}
  452 +
  453 +.iconClick {
  454 + margin-left: 21rpx;
  455 + margin-right: 16rpx;
  456 +}
  457 +
  458 +.radioCheck {
  459 + height: 100%;
  460 + display: flex;
  461 + align-items: center;
  462 + width: 65rpx;
  463 + justify-content: center;
  464 +}
  465 +
  466 +.scale {
  467 + transform: scale(0.8);
  468 +}
  469 +
  470 +.load {
  471 + width: 100%;
  472 + height: 80rpx;
  473 + padding: 0rpx 31rpx;
  474 +}
  475 +
  476 +.abs {
  477 + position: fixed;
  478 + left: 0rpx;
  479 + bottom: 0rpx;
  480 + height: 100rpx;
  481 + background-color: rgb(255, 255, 255);
  482 + width: 100%;
  483 + border-top: 1rpx solid #eee;
  484 +}
  485 +
  486 +.abs .left {
  487 + display: flex;
  488 + justify-content: space-between;
  489 + width: 515rpx;
  490 + padding-left: 31rpx;
  491 +}
  492 +
  493 +.abs .allClick {
  494 + margin-left: 31rpx;
  495 +}
  496 +
  497 +.abs icon {
  498 + margin-right: 31rpx;
  499 +}
  500 +
  501 +.abs .delete {
  502 + width: 235rpx;
  503 + height: 100%;
  504 + background-color: rgb(219, 27, 52);
  505 +}
  506 +.abs .Deleting{
  507 + background-color: rgb(131, 131, 131);
  508 +}
  509 +.abs .Number {
  510 + margin-right: 18rpx;
  511 + letter-spacing: 0rpx;
  512 + font-size: 32rpx;
  513 + height: 55rpx;
  514 +
  515 +}
  516 +.goods_num{
  517 + height: 55rpx;
  518 +line-height: 55rpx;
  519 +
49 520 }
50 521 \ No newline at end of file
... ...
pages/user/comment/comment.js
  1 +var ut = require("../../../utils/util.js");
1 2 var t = function(t) {
2 3 return t && t.__esModule ? t : {
3   - default: t
  4 + default: t
4 5 };
5   -}(require("../../../utils/LoadMore.js")), e = getApp(), rq = e.request, a = new t.default(),
6   - s = require("../../../utils/util.js"), oo = e.globalData, os = e.globalData.setting;
  6 + }(require("../../../utils/LoadMore.js")),
  7 + e = getApp(),
  8 + rq = e.request,
  9 + a = new t.default(),
  10 + s = require("../../../utils/util.js"),
  11 + oo = e.globalData,
  12 + os = e.globalData.setting;
  13 +var regeneratorRuntime = require('../../../utils/runtime.js');
7 14  
8 15 Page({
9   - data: {
10   - url: e.globalData.setting.url,
11   - resourceUrl: e.globalData.setting.imghost,
12   - iurl: e.globalData.setting.imghost,
13   - categories: [ {
14   - name: "全部评价",
15   - status: 2
16   - }, {
17   - name: "待评价",
18   - status: 0
19   - }, {
20   - name: "已评价",
21   - status: 1
22   - } ],
23   - activeStatus: 0,
24   - comments: null,
25   - currentPage: 1
26   - },
27   - onLoad: function(t) {
28   - var e = void 0 === t.status ? this.data.activeStatus : t.status;
29   - a.init(this, "", "comments"), this.requestComments(e);
30   - },
31   - onShow: function() {
32   - wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1),
33   - this.resetData(), this.requestComments(this.data.activeStatus));
34   - },
35   - changeTab: function(t) {
36   - this.resetData(), this.requestComments(t.currentTarget.dataset.status);
37   - },
38   - requestComments: function(t) {
39   - var e = this, th=e,n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage;
40   - console.log('requestComments');
41   - console.log(n);
42   - console.log(t);
  16 + data: {
  17 + url: e.globalData.setting.url,
  18 + resourceUrl: e.globalData.setting.imghost,
  19 + iurl: e.globalData.setting.imghost,
  20 + categories: [{
  21 + name: "全部评价",
  22 + status: 2
  23 + }, {
  24 + name: "待评价",
  25 + status: 0
  26 + }, {
  27 + name: "已评价",
  28 + status: 1
  29 + }],
  30 + activeStatus: 0,
  31 + comments: null,
  32 + currentPage: 1,
  33 + isloaded: 0,
  34 + order_id:0,
  35 + is_no_more:0,
  36 + },
  37 + onLoad: function(t) {
  38 + var e = void 0 === t.status ? this.data.activeStatus : t.status;
  39 + this.data.order_id=t.order_id;
  40 +
  41 + //a.init(this, "", "comments"),
  42 + //this.requestComments(e);
  43 + this.requestComments_new(e);
  44 + },
  45 + onShow: function() {
  46 + wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1),
  47 + this.resetData(), this.requestComments_new(this.data.activeStatus));
  48 + },
  49 + changeTab: function(t) {
  50 + var e = this;
  51 + if (this.data.activeStatus == t.currentTarget.dataset.status)
  52 + return false;
  53 + this.resetData(), this.requestComments_new(t.currentTarget.dataset.status);
  54 + },
  55 +
  56 + requestComments_new:async function(t){
  57 + var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage;
43 58 this.setData({
44 59 activeStatus: t
45 60 });
46   - if(t==2){
47   - a.request(n, function (t) {
48   - e.data.currentPage++;
49   - var da = th.data.comments;
50   - /*--
51   - da.forEach(function(em,ind){
52   - rq.get("/api/weshop/goods/get/" + os.stoid + "/" + em.goods_id, {
53   - success: function (tt) {
54   - var gd = tt.data.data.original_img;
55   - da[ind]['original_img'] = gd;
56   - th.setData({ comments: da, })
57   - },
58   - });
59   - })---*/
60   -
61   -
62   - }, null, { store_id: os.stoid, user_id: oo.user_id }),
63   - wx.stopPullDownRefresh();
64   - }else{
65   - a.request(n, function(t) {
66   - e.data.currentPage++;
67   - var da = th.data.comments;
68 61  
69   - /*--
70   - da.forEach(function (em, ind) {
71   - rq.get("/api/weshop/goods/get/" + os.stoid + "/" + em.goods_id, {
72   - success: function (tt) {
73   - var gd = tt.data.data.original_img;
74   - da[ind]['original_img'] = gd;
75   - th.setData({ comments: da, })
76   - },
77   - });
78   - });--*/
79   -
80   - }, null, {is_comment:t, store_id: os.stoid,user_id: oo.user_id }),
81   - wx.stopPullDownRefresh();
82   - }
83   -
84   - },
85   - onReachBottom: function() {
86   - a.canloadMore() && this.requestComments(this.data.activeStatus);
87   - },
88   - onPullDownRefresh: function(t) {
89   - this.resetData(), this.requestComments(this.data.activeStatus);
90   - },
91   - resetData: function() {
92   - this.data.comments = null, this.data.currentPage = 1, a.resetConfig();
93   - },
94   - /*-----评论-----*/
95   - comment: function(t) {
96   - for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++) ;
97   - if (!(s >= a.length)) {
  62 + if(e.data.order_id) n+="&order_id="+e.data.order_id;
  63 + var rq_data={store_id: os.stoid, user_id: oo.user_id};
  64 + if (t!= 2) {rq_data['is_comment']=t;}
  65 +
  66 + var rs_data=null,com_data=this.data.comments;
  67 + await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{
  68 + e.data.currentPage++
  69 + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  70 + rs_data=res.data.data.pageData;
  71 + }else{
  72 + th.setData({ is_no_more: 1, })
  73 + }
  74 + })
98 75  
99   - console.log("comment");
100   - console.log(a[s]);
  76 + if(rs_data){
  77 + for(var ind in rs_data ){
  78 + var em=rs_data[ind]
  79 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  80 + data:{ store_id: os.stoid, goods_id: em.goods_id,
  81 + pageSize: 3, parent_id: em.comment_id, page:1}
  82 + }).then(res=>{
  83 + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0)
  84 + rs_data[ind].replay_list=res.data.data.pageData;
  85 + })
  86 + if (em.img != undefined && em.img != null && ut.isString(em.img)) rs_data[ind].img = ut.unserialize(em.img);
  87 + var str = em.weapp_img;
  88 + if (str != "" && ut.isString(str)) rs_data[ind].weapp_img = JSON.parse(str);
  89 + rs_data[ind].original_img=this.data.iurl+rs_data[ind].original_img;
  90 + }
101 91  
102   - var n = "?order_id=" + a[s].order_id;
103   - n += "&goods_id=" + a[s].goods_id, n += "&goods_name=" + a[s].goods_name, n += "&price=" + a[s].goods_price,
104   - n += "&img=" + a[s].original_img,
105   - wx.navigateTo({
106   - url: "/pages/user/add_comment/add_comment" + n
107   - });
  92 + if(!com_data) com_data=rs_data;
  93 + else com_data= com_data.concat(rs_data);
  94 + th.setData({ comments: com_data, isloaded: 1, })
108 95 }
109 96 },
110 97  
111   - //图片失败,默认图片
112   - bind_bnerr2: function (e) {
113   - var _errImg = e.target.dataset.errorimg;
114   - var _errObj = {};
115   - _errObj[_errImg] = this.data.iurl+"/public/images/default_goods_image_240.gif";
116   - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
117   - }
  98 + onReachBottom: function() {
  99 + if(this.data.is_no_more) return false;
  100 + //a.canloadMore() && this.requestComments(this.data.activeStatus);
  101 + this.requestComments_new(this.data.activeStatus);
  102 + },
  103 +
  104 +
  105 + onPullDownRefresh: function(t) {
  106 + this.resetData(), this.requestComments_new(this.data.activeStatus);
  107 + },
  108 + resetData: function() {
  109 + this.data.comments = null, this.data.currentPage = 1, this.data.is_no_more=0, a.resetConfig();
  110 + },
  111 + /*-----评论-----*/
  112 + comment: function(t) {
  113 + for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++);
  114 + if (!(s >= a.length)) {
  115 + var n = "?order_id=" + a[s].order_id;
  116 + n += "&goods_id=" + a[s].goods_id, n += "&price=" + a[s].goods_price;
  117 + wx.navigateTo({
  118 + url: "/pages/user/add_comment/add_comment" + n
  119 + });
  120 + }
  121 + },
  122 +
  123 + //图片失败,默认图片
  124 + bind_bnerr2: function(e) {
  125 + var _errImg = e.currentTarget.dataset.errorimg;
  126 + var _errObj = {};
  127 + _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif";
  128 + //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  129 + },
  130 + //预览图片
  131 + previewImg: function(e) {
  132 + var index = e.currentTarget.dataset.index;
  133 + var sindex = e.currentTarget.dataset.sindex;
  134 + var name = e.currentTarget.dataset.name;
  135 + var imgArr = this.data.comments;
  136 + var image = null;
  137 + if (name == "img") {
  138 + image = imgArr[index].img[sindex];
  139 + } else {
  140 + image = imgArr[index].weapp_img[sindex];
  141 + }
  142 + wx.previewImage({
  143 + current: image,
  144 + //当前图片地址
  145 + urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式
  146 + })
  147 + },
  148 + //跳到首页
  149 + goto: function(ee) {
  150 + wx.switchTab({
  151 + url: '/pages/index/index/index',
  152 + })
  153 + },
118 154  
119 155 });
120 156 \ No newline at end of file
... ...
pages/user/comment/comment.wxml
  1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
1 2 <view class="container">
2   - <view class="type-navbar">
3   - <view class="type-box" wx:for="{{categories}}" wx:key="{{index}}">
4   - <view bindtap="changeTab" class="type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}">
5   - {{item.name}}
6   - </view>
7   - </view>
  3 + <view class="type-navbar padding">
  4 + <view class="type-box fs28 type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}" wx:for="{{categories}}" wx:key="{{index}}">
  5 + <view class="title_width" bindtap="changeTab" data-status="{{item.status}}">{{item.name}}</view>
8 6 </view>
9   -
10   - <view class="goods-container" wx:for="{{comments}}" wx:key="{{index}}">
11   - <view class="goods-box">
12   - <navigator class="goods-img" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
13   - <image class="wh100" src="{{item.original_img}}" binderror="bind_bnerr2" lazy-load="true"
14   - data-url="{{item.original_img}}" data-errorimg="comments[{{index}}].original_img"></image>
15   - </navigator>
16   - <navigator class="goods-desc" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
17   - <view class="goods-name ellipsis-1">{{item.goods_name}}</view>
18   - <view class="goods-name ellipsis-1">{{item.spec_key_name}}</view>
19   - <view class="buy-time">购买时间:{{item.order_add_time}}</view>
20   - </navigator>
21   - <navigator class="comment-button change-order" hidden="{{!item.comment_id}}" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">
22   - <image class="button-icon" src="{{iurl}}/miniapp/images/c23.png"></image> 查看订单
23   - </navigator>
24   - <view bindtap="comment" class="comment-button" data-recid="{{item.rec_id}}" hidden="{{item.comment_id}}">
25   - <image class="button-icon" src="{{iurl}}/miniapp/images/co.png"></image> 评价商品
  7 +
  8 + </view>
  9 +
  10 +<!-- 无评价 -->
  11 +<view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}">
  12 + <view class="flex-level">
  13 + <image src="{{iurl}}/miniapp/images/comment.png"></image>
  14 + </view>
  15 + <view class="flex-level fs30 xc-ash">当前暂无评价</view>
  16 + <view class="flex-level">
  17 + <navigator url="/pages/index/index/index" bindtap="goto">
  18 + <view class="flex-center fs28 white">去首页逛逛</view>
  19 + </navigator>
  20 + </view>
  21 +</view>
  22 +
  23 + <!-- 待评价栏 -->
  24 + <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}">
  25 +
  26 + <!-- 商品编号和状态 -->
  27 + <view class="Commodity_number flex-vertical-between fs26 padding border_bottom">
  28 + <!--商品编号 -->
  29 + <view>订单编号:{{item.order_sn}}</view>
  30 + <!-- 商品评价状态 -->
  31 + <view class="xc-wc">{{item.comment_id>0?'已评价':'待评价'}}</view>
  32 + </view>
  33 +
  34 + <!-- 商品详情集合 -->
  35 + <view class="detail_commoditys">
  36 + <!-- 单个商品 -->
  37 + <view>
  38 + <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
  39 + <!-- 商品图片 -->
  40 + <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image>
  41 + <!-- 商品内容 -->
  42 + <view class="Commodity_content">
  43 + <view class="Commodity_goods">
  44 + <!-- 商品名称 -->
  45 + <view class="goods_name ellipsis-2 fs26">{{item.goods_name}}</view>
  46 + <!-- 商品规格 -->
  47 + <view class="Commodity_spec fs20">
  48 + <view class="flex-center">{{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}}</view>
  49 + </view>
  50 + </view>
  51 + <!-- 商品价格数量 -->
  52 + <view class="Commodity_money flex-vertical-between baseline">
  53 + <!-- 商品价格 -->
  54 + <view class="flex-vertical xc-wc baseline">
  55 + <view class="fs20">¥</view>
  56 + <view class="fs30">{{filter.toFix(item.goods_price,2)}}</view>
  57 + </view>
  58 + <view class="fs26">x{{item.goods_num}}</view>
  59 +
26 60 </view>
  61 + </view>
  62 + </navigator>
  63 + <!-- 评论信息 -->
  64 + <view class="Commodity_evaluation padding border_bottom" wx:if="{{item.comment_id>0}}">
  65 + <!-- 评价星级 -->
  66 + <view class="starss flex fs26">
  67 + <view class="commen">评价:</view>
  68 + <view class="stars">
  69 + <image
  70 + src="{{imaitem>=item.deliver_rank?iurl+'/miniapp/images/StarswhiteUnCk.png':iurl+'/miniapp/images/StarsredCk.png'}}" data-ind="{{imaitem}}" data-oo="{{item.deliver_rank}}" wx:for="{{5}}" wx:for-index="imaitem" wx:for-item="{{item_start}}"></image>
  71 + </view>
  72 + </view>
  73 + <!-- 评价内容 -->
  74 + <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view>
  75 + <view class="Comment_images flex">
  76 + <image bindtap="previewImg" wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image>
  77 + <image bindtap="previewImg" wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image>
  78 +
  79 + </view>
  80 +
  81 + <!-- 商家回复 -->
  82 + <view class="reply rel" wx:if="{{item.replay_list}}">
  83 + <view class="line_bulge"></view>
  84 + <view class="shop-reply fs26">店家回复: </view>
  85 + <view class="shop-font fs24" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
  86 + {{r_item.content}}
  87 + </view>
  88 + </view>
  89 +
  90 +
  91 + <!-- 评价时间 -->
  92 + <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view>
27 93 </view>
28   - <view class="clear" hidden="{{!item.comment_id}}">
29   - <view class="fview" >评价:<image class='start_c' src="{{iurl}}/miniapp/images/stars{{(item.deliver_rank+item.goods_rank+item.service_rank)/3}}.png"></image></view>
30   - <view>{{item.content}}</view>
  94 + </view>
  95 + <!-- 去评价 -->
  96 + <view class="commodity_evaluate flex jc_sb padding baseline fs26">
  97 + <!-- 商品数量 -->
  98 + <view class="commodity_smy flex">
  99 + <view>共{{item.goods_num}}件商品</view>
  100 + <!-- 商品总价格 -->
  101 + <view class="flex commodity_money">
  102 + <view>合计:</view>
  103 + <view class="flex baseline xc-wc">
  104 + <view class="fs24">¥</view>
  105 + <view>{{filter.toFix(item.goods_price,2)}}</view>
  106 + </view>
  107 + </view>
31 108 </view>
  109 + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">
  110 + <view>查看订单</view>
  111 + </navigator>
  112 + <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="item.comment_id>0?'/pages/user/add_comment/add_comment':'' ">
  113 + <view class="fs24">去评价</view>
  114 + </navigator>
  115 + </view>
32 116 </view>
33   -
34   - <view class="no-data" wx:if="{{!comments||comments.length==0}}">
35   - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
36   - <view class="no-data-title">没有找到相关的记录</view>
37   - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator>
38   - </view>
39   -</view>
  117 + </view>
  118 +
  119 + <view class="get_bottom fs26" wx:if="{{comments.length>0 && is_no_more}}">已经加载到底部</view>
  120 +
  121 +</view>
40 122 \ No newline at end of file
... ...
pages/user/comment/comment.wxss
  1 +.padding {
  2 + padding: 0rpx 27rpx;
  3 +}
  4 +
  5 +.container {
  6 + background-color: rgb(255, 255, 255);
  7 +}
  8 +
1 9 .type-navbar {
2   - white-space: nowrap;
3   - display: flex;
4   - width: 100%;
5   - height: 80rpx;
6   - background-color: #fff;
  10 + white-space: nowrap;
  11 + display: flex;
  12 + height: 80rpx;
  13 + background-color: #fff;
  14 + border-top: 2rpx solid rgb(221, 221, 221);
  15 + justify-content: space-between;
  16 + color: rgb(51, 51, 51);
7 17 }
8 18  
9 19 .type-box {
10   - width: 33.3333333333%;
11   - box-sizing: border-box;
12   - font-size: 32rpx;
13   - line-height: 76rpx;
14   - padding: 0 20rpx;
15   - text-align: center;
16   - display: inline-block;
17   - overflow: hidden;
  20 + box-sizing: border-box;
  21 + line-height: 76rpx;
  22 + text-align: center;
  23 + display: inline-block;
  24 + overflow: hidden;
18 25 }
19 26  
20 27 .type-navbar-item {
21   - border-bottom: 4rpx solid #fff;
  28 + border-bottom: 4rpx solid #fff;
22 29 }
23 30  
24 31 .type-item-on {
25   - border-bottom: 4rpx solid #e64340;
  32 + /* width: 146rpx; */
  33 + border-bottom: 7rpx solid #e64340;
  34 +}
  35 +
  36 +.border_bottom {
  37 + border-bottom: 3rpx solid rgb(245, 245, 245);
  38 +}
  39 +/* 无评价 */
  40 +
  41 +.noCollection image {
  42 + width: 329rpx;
  43 + height: 229rpx;
  44 + margin-top: 202rpx;
  45 +}
  46 +
  47 +.noCollection .xc-ash {
  48 + margin-top: 10rpx;
  49 + font-weight: 600px;
  50 +}
  51 +
  52 +.noCollection navigator {
  53 + margin-top: 60rpx;
  54 + border-radius: 40rpx;
  55 +}
  56 +
  57 +.noCollection navigator view {
  58 + width: 247rpx;
  59 + height: 56rpx;
  60 + background-color: rgb(255, 72, 72);
  61 + border-radius: 40rpx;
  62 +}
  63 +
  64 +/* 待评价栏 */
  65 +
  66 +.Commodity_number {
  67 + height: 70rpx;
  68 + border-top: 13rpx solid rgb(245, 245, 245);
  69 +}
  70 +
  71 +/* 文字基线对齐 */
  72 +
  73 +.baseline {
  74 + display: flex;
  75 + align-items: baseline;
  76 +}
  77 +
  78 +/* 单个商品框架 */
  79 +
  80 +.detail_commodity {
  81 + height: 231rpx;
  82 +}
  83 +
  84 +.detail_commodity image {
  85 + width: 185rpx;
  86 + height: 185rpx;
26 87 }
27 88  
28   -.goods-container {
29   - /*--margin: 20rpx 0;--*/
30   - margin-top: 20rpx;
31   - background-color: #fff;
  89 +.detail_commodity .goods_name {
  90 + width: 485rpx;
  91 + /* height: 75rpx; */
  92 + line-height: 37rpx;
32 93 }
33 94  
34   -.goods-box {
35   -
36   - position: relative;
37   - padding: 20rpx 30rpx 0;
38   - font-size: 28rpx;
39   - clear: both;
  95 +.Commodity_content {
  96 + height: 185rpx;
  97 + margin-left: 21rpx;
40 98 }
41 99  
42   -.goods-img {
43   - float: left;
44   - height: 100rpx;
45   - width: 100rpx;
  100 +.Commodity_content .Commodity_goods {
  101 + height: 150rpx;
46 102 }
47 103  
48   -.goods-desc {
49   - float: left;
50   - width: 570rpx;
51   - margin-left: 20rpx;
  104 +.Commodity_content .Commodity_money {
  105 + font-size: 16rpx;
52 106 }
53 107  
54   -.goods-name {
55   - height: 44rpx;
56   - line-height: 44rpx;
57   - overflow: hidden;
  108 +/* 商品评价按钮框架 */
  109 +
  110 +.commodity_evaluate {
  111 + height: 110rpx;
  112 + padding-top: 15rpx;
58 113 }
59 114  
60   -.buy-time {
61   - margin-top: 20rpx;
62   - font-size: 26rpx;
63   - color: #b3b3b3;
  115 +.commodity_evaluate .commodity_smy .commodity_money {
  116 + margin-left: 29rpx;
  117 + letter-spacing: 1rpx;
64 118 }
65 119  
66   -.comment-button {
67   - font-size: 30rpx;
68   - color: #f23030;
69   - float: right;
70   - padding: 8rpx 10rpx;
71   - border: 1rpx #f23030 solid;
72   - margin-bottom: 20rpx;
  120 +.commodity_evaluate .commodity_To_evaluate {
  121 + width: 128rpx;
  122 + height: 39rpx;
  123 + border-radius: 9rpx;
  124 +}
  125 +.commodity_evaluate .commodity_To_evaluate view{
  126 + height: 39rpx;
  127 + line-height: 39rpx;
  128 +}
  129 +.commodity_evaluate .comment_go{
  130 + margin-top: 10rpx;
  131 + background-color: rgb(211, 28, 52);
  132 + color: rgb(255, 255, 255);
73 133 }
74 134  
75   -.change-order {
76   - color: #c2c2c2;
77   - border: 1rpx #c2c2c2 solid;
  135 +.Commodity_spec {
  136 + width: 106rpx;
  137 + background-color: rgb(236, 236, 236);
  138 + border-radius: 7rpx;
  139 + font-size: 18rpx;
  140 + margin-top: 10rpx;
78 141 }
79 142  
80   -.button-icon { height: 26rpx; width: 26rpx;}
81   -.start_c{
82   - height: 42rpx; width: 230rpx;
83   - top: 6rpx; position: relative;
  143 +.Commodity_spec view {
  144 + height: 28rpx;
  145 + align-items: center;
  146 +}
  147 +
  148 +.Commodity_evaluation .Comment_content {
  149 + color: rgb(153, 153, 153);
  150 + letter-spacing: 1rpx;
  151 +}
  152 +.Commodity_evaluation .starss{
  153 + height: 58rpx;
  154 + /* // line-height: 58rpx; */
  155 + align-items: center;
  156 +}
  157 +.Commodity_evaluation .commen{
  158 + height: 58rpx;
  159 + line-height: 58rpx;
  160 +}
  161 +.Commodity_evaluation .starss .stars{
  162 + line-height: 58rpx;
  163 +}
  164 +.Commodity_evaluation .starss .stars image {
  165 + width: 29rpx;
  166 + height: 26rpx;
  167 + margin-right: 5rpx;
  168 +}
  169 +
  170 +.Commodity_evaluation .Comment_images image {
  171 + width: 100rpx;
  172 + height: 100rpx;
  173 + margin-right: 8rpx;
  174 + margin-top: 18rpx;
  175 + border-radius: 6rpx;
  176 + border: 3rpx solid rgb(245, 245, 245);
  177 +}
  178 +.commodity_evaluate .View_evaluation{
  179 + border:2rpx solid rgb(179, 179, 179);
  180 + color:rgb(0, 0, 0);
  181 + background-color: rgb(255, 255, 255);
  182 +}
  183 +.comment_addtime{
  184 + height: 50rpx;
84 185 }
85   -.clear{clear: both; border-top: 1rpx solid #eee; font-size: 30rpx; padding-left: 30rpx}
86   -.clear view{margin-bottom: 10rpx;}
87   -.clear .fview{margin-top: 10rpx;}
88 186 \ No newline at end of file
  187 +.title_width{ width: 146rpx; text-align:center }
  188 +.shop-font{ color: rgb(153, 153, 153);}
  189 +.reply{ margin-top: 10rpx}
  190 +.get_bottom{ text-align: center; color: #999; margin-bottom: 20rpx}
89 191 \ No newline at end of file
... ...
utils/request.js
... ... @@ -43,7 +43,10 @@ module.exports = {
43 43 filePath: e.filePath,
44 44 name: e.name,
45 45 success: function(t) {
46   - i.hideLoading(), console.log("app.request", t), t.data = JSON.parse(i.filterJsonData(t.data)),
  46 + i.hideLoading();
  47 + if(t.statusCode==200)
  48 + t.data = JSON.parse(i.filterJsonData(t.data));
  49 + else { t={code:-1,msg:'调用接口失败'};}
47 50 i.doSuccess(e, t);
48 51 },
49 52 fail: function(t) {
... ...
utils/util.js
... ... @@ -258,6 +258,17 @@ function get_rand_item(arr){
258 258 return arr[ind];
259 259 }
260 260  
  261 +function getDistance(lat1, lng1, lat2, lng2){
  262 + var radLat1 = lat1*Math.PI / 180.0;
  263 + var radLat2 = lat2*Math.PI / 180.0;
  264 + var a = radLat1 - radLat2;
  265 + var b = lng1*Math.PI / 180.0 - lng2*Math.PI / 180.0;
  266 + var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
  267 + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
  268 + s = s *6378.137 ;// EARTH_RADIUS;
  269 + return s;
  270 +}
  271 +
261 272 module.exports = {
262 273 formatTime: function(e, r) {
263 274 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) {
... ... @@ -347,6 +358,6 @@ module.exports = {
347 358 sub_last: sub_last,//去掉末尾一个字符
348 359 measureText: measureText,//画布需要的函数
349 360 check_mobile: check_mobile,//验证手机
350   - get_rand_item:get_rand_item, //随机获取元素
351   -
  361 + get_rand_item:get_rand_item, //随机获取元素
  362 + getDistance:getDistance //获取俩个经纬网度之间的距离
352 363 };
... ...