Commit fbc73ab941b4ba7c2fb4df5e6868ccca9edfd922

Authored by 后端研发-苏明海
2 parents b47ca3e7 9e8d61f1

Merge branch 'dev' into 'test'

Dev

See merge request !639
Showing 74 changed files with 3853 additions and 5381 deletions
@@ -113,9 +113,9 @@ App({ @@ -113,9 +113,9 @@ App({
113 wx.getSystemInfo({ 113 wx.getSystemInfo({
114 success: (res) => { 114 success: (res) => {
115 // console.log(res) 115 // console.log(res)
116 - let modelmes = res.model; //手机品牌 116 + let modelmes = res?res.model:null; //手机品牌
117 console.log('手机品牌', modelmes) 117 console.log('手机品牌', modelmes)
118 - if (modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来 118 + if (modelmes && modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来
119 this.globalData.isIpx = true 119 this.globalData.isIpx = true
120 } 120 }
121 }, 121 },
@@ -129,27 +129,36 @@ App({ @@ -129,27 +129,36 @@ App({
129 th.promiseGet(turl,{}).then(res=>{ 129 th.promiseGet(turl,{}).then(res=>{
130 var o=res; 130 var o=res;
131 if(o.data.code==0){ 131 if(o.data.code==0){
132 - th.globalData.config2 = o.data.data; 132 + th.globalData.config2 = o.data.data;
133 //有配置成要验证过期,因为过期的小程序没有办法审核 133 //有配置成要验证过期,因为过期的小程序没有办法审核
134 - if(th.globalData.config2.is_overdue){  
135 - 134 + if(th.globalData.config2 && th.globalData.config2.is_overdue){
  135 +
136 //要开始验证,小程序有没有购买和过期 136 //要开始验证,小程序有没有购买和过期
137 - if(!currentPage || currentPage.route.indexOf('error/error')==-1){ 137 + if(!currentPage || currentPage.route.indexOf('error/error')==-1 || currentPage.route.indexOf('index/index')==-1){
138 var tt=this.globalData.wxapp_buy_obj; 138 var tt=this.globalData.wxapp_buy_obj;
139 if (!tt){ 139 if (!tt){
140 this.get_isbuy(function (){ 140 this.get_isbuy(function (){
141 tt=th.globalData.wxapp_buy_obj; 141 tt=th.globalData.wxapp_buy_obj;
142 if (tt.isout == 1){ 142 if (tt.isout == 1){
143 th.promiseGet('/api/weshop/store/get/'+t.stoid,{}).then(res=>{ 143 th.promiseGet('/api/weshop/store/get/'+t.stoid,{}).then(res=>{
144 - wx.reLaunch({  
145 - url: "/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:"+res.data.data.store_tel,  
146 - }); 144 +
  145 + if(!th.err_going){
  146 + wx.reLaunch({
  147 + url: "/pages/error/error?msg=该商城已到期,暂停浏览1!\r\n可联系:"+res.data.data.store_tel,
  148 + });
  149 + }
147 }) 150 })
148 } 151 }
149 - else if (tt.isbuy == 0)  
150 - wx.reLaunch({  
151 - url: "/pages/error/error?msg=还未购买小程序",  
152 - }); 152 + else if (tt.isbuy == 0){
  153 +
  154 + if(!th.err_going){
  155 + wx.reLaunch({
  156 + url: "/pages/error/error?msg=还未购买小程序",
  157 + });
  158 + }
  159 +
  160 + }
  161 +
153 }) 162 })
154 } 163 }
155 } 164 }
@@ -200,8 +209,13 @@ App({ @@ -200,8 +209,13 @@ App({
200 } 209 }
201 }, 210 },
202 //----------------获取配置参数-------------------- 211 //----------------获取配置参数--------------------
203 - getConfig: function(t, o) {  
204 - var e = this; if(this.globalData.config==undefined) this.globalData.config=null; 212 + getConfig: function(t, o) {
  213 + var e = this;
  214 + if(!e.globalData.setting.stoid){
  215 + t(null);
  216 + return false;
  217 + }
  218 + if(this.globalData.config==undefined) this.globalData.config=null;
205 this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.request.get("/api/weshop/store/get/" + e.globalData.setting.stoid, { 219 this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.request.get("/api/weshop/store/get/" + e.globalData.setting.stoid, {
206 success: function(o) { 220 success: function(o) {
207 console.log('getConfig'); 221 console.log('getConfig');
@@ -211,10 +225,13 @@ App({ @@ -211,10 +225,13 @@ App({
211 } 225 }
212 }); 226 });
213 }, 227 },
214 -  
215 //----------------获取配置参数-------------------- 228 //----------------获取配置参数--------------------
216 - getConfig2: function (t, o) { 229 + getConfig2: function (t, o) {
217 var e = this; 230 var e = this;
  231 + if(!e.globalData.setting.stoid) {
  232 + t(null);
  233 + return false;
  234 + }
218 this.globalData.config2 && !o ? 235 this.globalData.config2 && !o ?
219 "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, { 236 "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, {
220 success: function (o) { 237 success: function (o) {
app.json
@@ -139,7 +139,9 @@ @@ -139,7 +139,9 @@
139 "pages/my_service/tment_details", 139 "pages/my_service/tment_details",
140 "pages/my_service/tment_eval", 140 "pages/my_service/tment_eval",
141 "pages/my_service/tment_order_list", 141 "pages/my_service/tment_order_list",
142 - "pages/my_service/beauty_deta" 142 + "pages/my_service/beauty_deta",
  143 + "pages/profile/profile",
  144 + "pages/parseHtml/parseHtml"
143 ] 145 ]
144 146
145 }], 147 }],
components/diy_goodsGroup/diy_goodsGroup.js
@@ -75,9 +75,13 @@ Component({ @@ -75,9 +75,13 @@ Component({
75 } 75 }
76 76
77 // 在组件实例进入页面节点树时执行 77 // 在组件实例进入页面节点树时执行
78 - this.data.classstyle_id = nav_item.classstyle; 78 + if(nav_item) {
  79 + this.data.classstyle_id = nav_item.classstyle;
  80 + this.data.wgroup =nav_item.wgroup;
  81 + }
  82 +
79 this.data.goodscount = this.data.object.goodscount; 83 this.data.goodscount = this.data.object.goodscount;
80 - this.data.wgroup =nav_item.wgroup; 84 +
81 85
82 var hei=280; 86 var hei=280;
83 if(this.data.object.goodstit) hei+=80; 87 if(this.data.object.goodstit) hei+=80;
@@ -86,13 +90,13 @@ Component({ @@ -86,13 +90,13 @@ Component({
86 90
87 this.setData({swiper_hei:hei}); 91 this.setData({swiper_hei:hei});
88 92
89 - if (nav_item.goodsclass == 1) { 93 + if (nav_item && nav_item.goodsclass == 1) {
90 this.data.is_recommend = 1 94 this.data.is_recommend = 1
91 } 95 }
92 - if (nav_item.goodsclass == 2) { 96 + if (nav_item && nav_item.goodsclass == 2) {
93 this.data.is_hot = 1 97 this.data.is_hot = 1
94 } 98 }
95 - if (nav_item.goodsclass == 3) { 99 + if (nav_item && nav_item.goodsclass == 3) {
96 this.data.is_new = 1 100 this.data.is_new = 1
97 } 101 }
98 102
@@ -353,8 +357,9 @@ Component({ @@ -353,8 +357,9 @@ Component({
353 wx.showLoading(); 357 wx.showLoading();
354 358
355 var nav_item=this.data.object.nav_list[title_idx]; 359 var nav_item=this.data.object.nav_list[title_idx];
356 -  
357 - this.data.g_id = this.data.object.nav_list[title_idx].data; 360 + this.data.g_id =[];
  361 + if(this.data.object.nav_list && this.data.object.nav_list[title_idx] && this.data.object.nav_list[title_idx].data)
  362 + this.data.g_id=this.data.object.nav_list[title_idx].data;
358 var arr = []; 363 var arr = [];
359 for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { 364 for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
360 arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); 365 arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
@@ -364,18 +369,21 @@ Component({ @@ -364,18 +369,21 @@ Component({
364 this.data.requestData=[]; 369 this.data.requestData=[];
365 370
366 // 在组件实例进入页面节点树时执行 371 // 在组件实例进入页面节点树时执行
367 - this.data.classstyle_id = nav_item.classstyle;  
368 - this.data.wgroup =nav_item.wgroup; 372 + if(nav_item){
  373 + this.data.classstyle_id = nav_item.classstyle;
  374 + this.data.wgroup =nav_item.wgroup;
  375 + }
  376 +
369 377
370 this.data.is_recommend = this.data.is_hot=this.data.is_new=0; 378 this.data.is_recommend = this.data.is_hot=this.data.is_new=0;
371 //推荐,热卖,新品 379 //推荐,热卖,新品
372 - if (nav_item.goodsclass == 1) { 380 + if (nav_item && nav_item.goodsclass == 1) {
373 this.data.is_recommend = 1 381 this.data.is_recommend = 1
374 } 382 }
375 - if (nav_item.goodsclass == 2) { 383 + if (nav_item && nav_item.goodsclass == 2) {
376 this.data.is_hot = 1 384 this.data.is_hot = 1
377 } 385 }
378 - if (nav_item.goodsclass == 3) { 386 + if (nav_item && nav_item.goodsclass == 3) {
379 this.data.is_new = 1 387 this.data.is_new = 1
380 } 388 }
381 389
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -304,9 +304,10 @@ @@ -304,9 +304,10 @@
304 .zs_wz1_2l { 304 .zs_wz1_2l {
305 overflow: hidden; 305 overflow: hidden;
306 text-overflow: ellipsis; 306 text-overflow: ellipsis;
307 - margin-bottom: 10rpx;  
308 font-size: 30rpx; 307 font-size: 30rpx;
309 white-space: nowrap; 308 white-space: nowrap;
  309 + height: 40rpx;
  310 + line-height: 40rpx;
310 margin-top: 10rpx; 311 margin-top: 10rpx;
311 } 312 }
312 313
components/diy_nav/diy_nav.js
@@ -45,9 +45,9 @@ Component({ @@ -45,9 +45,9 @@ Component({
45 customMethod: function () { }, 45 customMethod: function () { },
46 //智能跳转 46 //智能跳转
47 go_url:function (e) { 47 go_url:function (e) {
48 - var url=e.currentTarget.dataset.url;  
49 - console.log('url==>', url);  
50 - // getApp().goto(url); 48 + var url=e.currentTarget.dataset.url;
  49 + console.log('url==>', url);
  50 + getApp().goto(url);
51 } 51 }
52 } 52 }
53 }) 53 })
54 \ No newline at end of file 54 \ No newline at end of file
components/diy_searchbox/diy_searchbox.wxml
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <view style='background-color:{{object.top_bgcolor}}; display: flex; align-items: center; justify-content: space-around; height: 100rpx;' > 22 <view style='background-color:{{object.top_bgcolor}}; display: flex; align-items: center; justify-content: space-around; height: 100rpx;' >
23 <view class='s2_left'> 23 <view class='s2_left'>
24 <navigator open-type="switchTab" url="/pages/goods/categoryList/categoryList" class="s1_gk_a1"> 24 <navigator open-type="switchTab" url="/pages/goods/categoryList/categoryList" class="s1_gk_a1">
25 - <image src='/public/static/images/model/nav.png' style="margin:0;position: relative;left: 6rpx"></image> 25 + <image src='{{imghost}}/miniapp/images/model/nav.png' style="margin:0;position: relative;left: 6rpx"></image>
26 </navigator> 26 </navigator>
27 </view> 27 </view>
28 <view class='s2_cen' style='background-color:{{object.inner_bgcolor}}'> 28 <view class='s2_cen' style='background-color:{{object.inner_bgcolor}}'>
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 </view> 38 </view>
39 <view class='s2_right'> 39 <view class='s2_right'>
40 <navigator open-type="switchTab" url="/pages/cart/cart/cart" class="s1_gk_a1"> 40 <navigator open-type="switchTab" url="/pages/cart/cart/cart" class="s1_gk_a1">
41 - <image src='/public/static/images/model/car.png' style="margin:0;;"></image> 41 + <image src='{{imghost}}/miniapp/images/model/car.png' style="margin:0;;"></image>
42 </navigator> 42 </navigator>
43 </view> 43 </view>
44 </view> 44 </view>
components/full_screen/filter.wxs deleted
1 -var format = function (text) {  
2 -  
3 - if (!text) {  
4 - return  
5 - }  
6 - var reg = getRegExp('\\\\n', 'g')  
7 - return text.replace(reg, '\n')  
8 -}  
9 -  
10 -module.exports = {  
11 - format: format  
12 -}  
components/full_screen/full_screen.js deleted
1 -// components/userqy_pop_up/userqy_pop_up.js  
2 -var o = getApp().globalData.setting  
3 -Component({  
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 - data: {  
8 - control: 1,  
9 - is_full_screen_show:0, //全屏显示  
10 - sec_show:3, //倒计时的秒数  
11 - full_ad:null, //全屏广告  
12 - url:o.imghost,  
13 - full_screen:0,  
14 - is_full_screen_men:1,  
15 - hidden:0,  
16 - },  
17 -  
18 - pageLifetimes:{  
19 - hide: function() {  
20 - // 页面被隐藏  
21 - clearInterval(this.data.full_screen);  
22 - },  
23 - },  
24 -  
25 - ready: function () {},  
26 - properties: {},  
27 - methods: {  
28 - close_full_screen(){  
29 - this.setData({is_full_screen_show:0,sec_show:0});  
30 - },  
31 - //-- 跳转到满屏广告的链接 --  
32 - go_full_ad(){  
33 - if(!this.data.full_ad) return false;  
34 - if(!this.data.full_ad.ad_weapplink) return false;  
35 - getApp().goto(this.data.full_ad.ad_weapplink);  
36 - },  
37 - get_the_full_screen(){  
38 - if(this.data.full_ad) {  
39 - return false;  
40 - }  
41 - var th=this;  
42 - //获取全屏的广告  
43 - getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{  
44 - data: { enabled: 1 }  
45 - }).then(res=>{  
46 - //判断是不是有全屏广告  
47 - if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){  
48 - th.setData({  
49 - is_full_screen_show:1,  
50 - full_ad:res.data.data.pageData[0],  
51 - })  
52 - //--定时关闭--  
53 - th.data.full_screen=setInterval(function(){  
54 - if(!th.data.sec_show) {  
55 - clearInterval(th.data.full_screen);  
56 - th.close_full_screen();  
57 - return false;  
58 - }  
59 - th.data.sec_show--;  
60 - th.setData({sec_show:th.data.sec_show});  
61 - },1000)  
62 -  
63 - }  
64 - })  
65 - }  
66 - },  
67 -  
68 -})  
69 \ No newline at end of file 0 \ No newline at end of file
components/full_screen/full_screen.json deleted
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
5 \ No newline at end of file 0 \ No newline at end of file
components/full_screen/full_screen.wxml deleted
1 -<!-- 全屏控制 -->  
2 -<view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');">  
3 - <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view>  
4 -</view>  
5 -  
6 -  
7 -  
components/full_screen/full_screen.wxss deleted
1 -.full_screen{  
2 - position: fixed;left: 0;top: 0;  
3 - z-index: 1000000000000;  
4 - background-color: rgba(0,0,0,0.4);  
5 - width: 100%;  
6 - height: 100%;  
7 - background-position: center;  
8 - background-size: 100% 100%;  
9 - background-repeat: no-repeat;  
10 -}  
11 -.skip_box{  
12 - float: right; margin-top: 10rpx; margin-right: 10rpx;  
13 - background-color: gainsboro; width: 120rpx;  
14 - height: 48rpx; font-size: 28rpx; line-height: 48rpx;  
15 - text-align: center; border-radius: 20rpx;  
16 - }  
17 \ No newline at end of file 0 \ No newline at end of file
components/share/share.wxss
@@ -51,6 +51,7 @@ @@ -51,6 +51,7 @@
51 width: 50%; 51 width: 50%;
52 padding: 30rpx; 52 padding: 30rpx;
53 text-align: center; 53 text-align: center;
  54 + line-height: 1;
54 } 55 }
55 56
56 .icon-container { 57 .icon-container {
@@ -78,7 +79,7 @@ @@ -78,7 +79,7 @@
78 .title { 79 .title {
79 font-size: 28rpx; 80 font-size: 28rpx;
80 color: #7b7b7b; 81 color: #7b7b7b;
81 - padding-top: 10rpx; 82 + padding-top: 20rpx;
82 } 83 }
83 84
84 .btn-cancel { 85 .btn-cancel {
packageA/pages/cardDetails/cardDetails.wxml
@@ -17,3 +17,5 @@ @@ -17,3 +17,5 @@
17 <view class="pd20">{{details.serviceContent}}</view> 17 <view class="pd20">{{details.serviceContent}}</view>
18 </view> 18 </view>
19 </view> 19 </view>
  20 +
  21 +<nav_box object="{{item.content}}"></nav_box>
packageA/pages/cardList/cardList.js
@@ -11,13 +11,12 @@ Page({ @@ -11,13 +11,12 @@ Page({
11 list: null, 11 list: null,
12 isLoading: false, // 检测是否已经发送请求,防止重复发送请求 12 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
13 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 13 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
14 - pageNum: 1, // 当前页数  
15 - 14 + pageNum: 1, // 当前页数
16 currentQuery: { 15 currentQuery: {
17 store_id: app.globalData.setting.stoid, 16 store_id: app.globalData.setting.stoid,
18 - },  
19 - 17 + },
20 default_img: '/miniapp/images/default_g_img.gif', 18 default_img: '/miniapp/images/default_g_img.gif',
  19 + object:null,
21 }, 20 },
22 21
23 /** 22 /**
@@ -30,7 +29,15 @@ Page({ @@ -30,7 +29,15 @@ Page({
30 userInfo: data, 29 userInfo: data,
31 imghost: app.globalData.setting.imghost, 30 imghost: app.globalData.setting.imghost,
32 }); 31 });
33 - }); 32 + });
  33 + var url="/api/weshop/store_module/gets/"+app.globalData.setting.stoid+"/0/5";
  34 + getApp().promiseGet(url,{}).then(res=>{
  35 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  36 + var json=JSON.parse(res.data.data[0].json_str);
  37 + var content=json[0].content;
  38 + self.setData({object:content});
  39 + }
  40 + })
34 }, 41 },
35 42
36 /** 43 /**
@@ -54,8 +61,8 @@ Page({ @@ -54,8 +61,8 @@ Page({
54 isLogin: true, 61 isLogin: true,
55 }); 62 });
56 63
57 - this.getData(true, url, currentQuery);  
58 - 64 + currentQuery.page=1;
  65 + this.getData(true, url, currentQuery);
59 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { 66 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
60 // data: { 67 // data: {
61 // enabled: 1 68 // enabled: 1
@@ -64,7 +71,6 @@ Page({ @@ -64,7 +71,6 @@ Page({
64 // console.log('res==>1', res); 71 // console.log('res==>1', res);
65 // }); 72 // });
66 73
67 -  
68 app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { 74 app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
69 data: { 75 data: {
70 enabled: 1 76 enabled: 1
@@ -132,9 +138,7 @@ Page({ @@ -132,9 +138,7 @@ Page({
132 /** 138 /**
133 * promiseGet请求数据 139 * promiseGet请求数据
134 */ 140 */
135 - getData: function(isInit, url, data) {  
136 - return new Promise(function(resolve, reject) {  
137 - 141 + getData: function(isInit, url, data,callback) {
138 app.request.promiseGet(url, { 142 app.request.promiseGet(url, {
139 data: data, 143 data: data,
140 isShowLoading: true, 144 isShowLoading: true,
@@ -167,18 +171,18 @@ Page({ @@ -167,18 +171,18 @@ Page({
167 self.setData({ 171 self.setData({
168 'list.pageData': [] 172 'list.pageData': []
169 }); 173 });
170 - };  
171 - resolve(); 174 + };
  175 + if(callback) callback();
  176 +
172 }) 177 })
173 .catch(function(err) { 178 .catch(function(err) {
174 console.log('出错拉!!!!',err); 179 console.log('出错拉!!!!',err);
175 self.setData({ 180 self.setData({
176 'list.pageData': [] 181 'list.pageData': []
177 }); 182 });
  183 +
  184 + if(callback) callback();
178 }); 185 });
179 -  
180 - });  
181 -  
182 }, 186 },
183 187
184 188
@@ -202,12 +206,9 @@ Page({ @@ -202,12 +206,9 @@ Page({
202 isLoading: true, 206 isLoading: true,
203 pageNum: this.data.pageNum + 1 207 pageNum: this.data.pageNum + 1
204 }); 208 });
205 - requestData.page = this.data.pageNum; 209 + requestData.page = this.data.pageNum;
  210 + this.getData(false, url, requestData,callback)
206 211
207 - this.getData(false, url, requestData)  
208 - .then(function() {  
209 - callback();  
210 - });  
211 }; 212 };
212 }, 213 },
213 214
@@ -216,4 +217,12 @@ Page({ @@ -216,4 +217,12 @@ Page({
216 var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid; 217 var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid;
217 app.goto(url); 218 app.goto(url);
218 }, 219 },
  220 +
  221 + //图片失败,默认图片
  222 + bind_bnerr: function(e) {
  223 + var _errImg = e.target.dataset.errorimg;
  224 + var _errObj = {};
  225 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  226 + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  227 + },
219 }) 228 })
220 \ No newline at end of file 229 \ No newline at end of file
packageA/pages/cardList/cardList.json
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 "navigationBarTitleText": "卡项列表", 2 "navigationBarTitleText": "卡项列表",
3 "enablePullDownRefresh": false, 3 "enablePullDownRefresh": false,
4 "usingComponents": { 4 "usingComponents": {
5 - "nodata": "/components/nodata/nodata" 5 + "nodata": "/components/nodata/nodata",
  6 + "advertising":"/components/diy_advertising/diy_advertising",
  7 + "nav_box":"/components/nav_box/nav_box"
6 } 8 }
7 } 9 }
8 \ No newline at end of file 10 \ No newline at end of file
packageA/pages/cardList/cardList.wxml
  1 +<block wx:if="{{object}}">
  2 + <view class="bg_view" style="background-color:{{object.bg_color}};">
  3 + <advertising object="{{object}}"></advertising>
  4 + <!-- 列表 -->
  5 + <block wx:if="{{object.column=='4'}}">
  6 +
  7 + <view class="{{object.noboder!=1?'b-bottom':''}}" wx:for="{{list.pageData}}" style="padding: 10rpx 20rpx;"
  8 + bindtap="go_goods" data-gid="{{item.id}}">
  9 +
  10 + <view class="flex bg-white ">
  11 + <view>
  12 + <image class="image" src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}"
  13 + lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
  14 + />
  15 + </view>
  16 + <view class="flex fdc space-bt f1 pdl20">
  17 + <view>
  18 + <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
  19 + <view class="fs24 c7b">有效天数:{{item.validDays?item.validDays:0}}</view>
  20 + </view>
  21 + <view class="flex space-bt ali-c">
  22 + <view class="price">{{item.money}}</view>
  23 + </view>
  24 + <view style="height: 10rpx;"></view>
  25 + </view>
  26 + </view>
  27 + </view>
  28 +
  29 + </block>
  30 + <!-- 一列和俩列 -->
  31 + <block wx:else>
  32 + <view class="pd20 flex-set" style="background-color: #{{object.bg_color}};">
  33 + <!-- 1列 2列 -->
  34 + <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white"
  35 + bindtap="go_goods" data-gid="{{item.id}}"
  36 + style="margin-bottom: 20rpx;">
  37 + <view style="width: 100%;">
  38 + <image style="width: 100%;" lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
  39 + src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}" mode="aspectFill"/></view>
  40 + <view class="flex fdc space-bt f1 pdl20">
  41 + <view>
  42 + <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
  43 + <view class="fs24 c7b">有效天数:{{item.validDays?item.validDays:'不限'}}</view>
  44 + </view>
  45 + <view class="flex space-bt ali-c">
  46 + <view class="price">{{item.money}}</view>
  47 + </view>
  48 + <view style="height: 10rpx;"></view>
  49 + </view>
  50 + </view>
  51 + </view>
  52 + </block>
  53 +
  54 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  55 + <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
  56 + </view>
  57 +</block>
  58 +
  59 +<block wx:else>
1 <view class="page"> 60 <view class="page">
2 <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic"> 61 <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic">
3 <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item> 62 <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item>
4 - <!-- <swiper-item>234</swiper-item>  
5 - <swiper-item>345</swiper-item> -->  
6 - </swiper>  
7 - 63 + </swiper>
8 <scroll-view class="scroll-view" scroll-y> 64 <scroll-view class="scroll-view" scroll-y>
9 <view class="bg-white"> 65 <view class="bg-white">
10 - <view class="flex pd20" wx:for="{{list.pageData}}"> 66 + <view class="flex pd20" wx:for="{{list.pageData}}" bindtap="go_goods" data-gid="{{item.id}}">
11 <view> 67 <view>
12 - <image class="image" src="{{imghost + item.imgUrl}}"/> 68 + <image class="image"
  69 + lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
  70 + src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}"
  71 + />
13 </view> 72 </view>
14 <view class="flex fdc space-bt f1 pdl20"> 73 <view class="flex fdc space-bt f1 pdl20">
15 <view> 74 <view>
16 <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view> 75 <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
17 - <view class="fs24 c7b">有效天数:{{item.validDays}}</view> 76 + <view class="fs24 c7b">有效天数:{{item.validDays?item.validDays:0}}</view>
18 </view> 77 </view>
19 <view class="flex space-bt ali-c"> 78 <view class="flex space-bt ali-c">
20 <view class="price">{{item.money}}</view> 79 <view class="price">{{item.money}}</view>
21 - <view class="btn-details" bindtap="go_goods" data-gid="{{item.id}}">卡项详情</view> 80 + <view class="btn-details" >卡项详情</view>
22 </view> 81 </view>
23 </view> 82 </view>
24 </view> 83 </view>
25 84
26 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata> 85 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
27 </view> 86 </view>
28 - <!-- <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata> -->  
29 - <view class="noMore">- 已经到底了 -</view> 87 +
  88 + <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
30 </scroll-view> 89 </scroll-view>
31 </view> 90 </view>
  91 +</block>
  92 +<nav_box id="nav_box"></nav_box>
32 \ No newline at end of file 93 \ No newline at end of file
packageA/pages/cardList/cardList.wxss
1 /* pages/i_service/cardList/cardList.wxss */ 1 /* pages/i_service/cardList/cardList.wxss */
2 -page, 2 +page{ background-color: #f2f2f2;}
  3 +
  4 +
3 .page { 5 .page {
4 height: 100%; 6 height: 100%;
5 } 7 }
6 -  
7 -page {  
8 - background-color: #f2f2f2;  
9 -}  
10 -  
11 .scroll-view { 8 .scroll-view {
12 height: calc(100% - 300rpx); 9 height: calc(100% - 300rpx);
13 } 10 }
@@ -64,4 +61,21 @@ page { @@ -64,4 +61,21 @@ page {
64 .swiper-img { 61 .swiper-img {
65 display: block; 62 display: block;
66 margin: auto; 63 margin: auto;
  64 +}
  65 +
  66 +.list_item{ display: inline-block;}
  67 +.w100{ width: 100%;}
  68 +.w50{ width: 49%; }
  69 +.w50.ml{margin-left: 12rpx;}
  70 +
  71 +.w50 image{ width: 100%; height: 340rpx; }
  72 +.flex-set{display: flex;flex-wrap: wrap;}
  73 +
  74 +.b-bottom{ border-bottom:1rpx solid #fff}
  75 +.bg_view{
  76 + display: block;
  77 + min-height: 100%;
  78 + width: 100%;
  79 + position: absolute;
  80 + left: 0;top: 0;z-index: 1;
67 } 81 }
68 \ No newline at end of file 82 \ No newline at end of file
packageA/pages/cart2_ser/cart2_ser.js 0 → 100644
  1 +var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"),
  2 + s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp();
  3 +var oo=t.globalData.setting,os=oo;
  4 +var regeneratorRuntime = require('../../../utils/runtime.js');
  5 +var util_pay = require("../../../utils/pay.js");
  6 +
  7 +Page({
  8 + data: {
  9 + url: t.globalData.setting.url,
  10 + resourceUrl: t.globalData.setting.resourceUrl,
  11 + imgUrl: t.globalData.setting.imghost,
  12 +
  13 + invoiceToggle: !0,
  14 + payWithUserMoney: !0,
  15 + payWithPoints: !0,
  16 + maxWord: 0,
  17 + enterAddressPage: !1,
  18 +
  19 + //页面获取的参数
  20 + param:null,
  21 + postdata:null,
  22 + //提交订单的格式
  23 + formData: {
  24 + order_amount:0,//支付金额
  25 + total_amount:0,//总价
  26 + all_price:0,//商品卖的总价
  27 + pay_points: 0,//使用积分
  28 + user_money: 0,//使用余额
  29 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  30 + shipping_price:0,//物流费用
  31 + },
  32 +
  33 + /*----------------立即购买---------------------*/
  34 + is_b_now:0, //0是购物车结算 1立即购买
  35 + bn_goods:null, //立即购买时候的调用商品
  36 + bn_use_money:0,//是否使用余额
  37 + bn_pick:0, //选择的门店
  38 + bn_pickname: "", //选择的门店名称
  39 +
  40 + /*------------------------*/
  41 + //判断页面是返回回来的还是 首次进入的
  42 + yuer:0,
  43 + },
  44 + onLoad: function(t) {
  45 + wx.setNavigationBarTitle({
  46 + title: "填写订单",
  47 + });
  48 +
  49 + var appD=getApp().globalData.service_now;
  50 + this.data.postdata=appD;
  51 + this.data.param=t;
  52 + var th=this;
  53 +
  54 + getApp().promiseGet("/api/wx/weappSendlist/page", {
  55 + data: {
  56 + store_id: os.stoid,
  57 + typeid: "1001"
  58 + }}).then(res=>{
  59 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  60 + var template_id = res.data.data.pageData[0].template_id;
  61 + th.setData({template_id:template_id});
  62 + }
  63 + })
  64 +
  65 + },
  66 + onUnload: function () { this.setData({ isclose: 1 })},
  67 +
  68 + //------获取会员信息-----先获取用户信息,在进行下一步---
  69 + get_info:function(func){
  70 + var user_id = t.globalData.user_id;
  71 + to.auth.get_u(func);
  72 + },
  73 +
  74 +
  75 + //----------------展示页面,是再获取用户信息之后--------------
  76 + show_page:function(){
  77 + var th=this;
  78 + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取
  79 + var user=getApp().globalData.userInfo;
  80 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  81 + data:{r:Math.random()},
  82 + success: function (e) {
  83 +
  84 + getApp().globalData.userInfo = e.data.data;
  85 + th.setData({userinfo:e.data.data});
  86 + //获取立即购买的商品信息
  87 + th.get_buy_goods();
  88 +
  89 + //获取提现金额
  90 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  91 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  92 + success: function (su) {
  93 + if (su.data.code == 0) {
  94 + var yuer = parseFloat(th.data.userinfo.user_money -
  95 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  96 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  97 + }
  98 + }
  99 + });
  100 + }
  101 + });
  102 + },
  103 +
  104 + //-----获取立即购买的商品信息----
  105 + get_buy_goods: function (){
  106 + var th=this,a=getApp().request;
  107 + var gg = th.data.postdata;
  108 + var url="/api/weshop/serviceCard/get/" + oo.stoid + "/" + gg.id
  109 + //调用商品
  110 + a.get(url, {
  111 + success: function (t) {
  112 + var gd = t.data.data;
  113 + t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
  114 + t.data.data['buynum'] = gg.goods_num;
  115 + t.data.data.shop_price=gd.money;
  116 +
  117 + th.setData({
  118 + bn_goods: t.data.data, bn_pickname: gg.pick_name,
  119 + bn_pick: gg.pick_id
  120 + });
  121 + th.calculatePrice2();
  122 +
  123 + }
  124 + });
  125 + },
  126 +
  127 + //----------子页返回父页触发----------
  128 + onShow: function() {
  129 + var th=this;
  130 + if (th.data.isclose==0){
  131 + wx.navigateTo({
  132 + url: "/pages/index/index/index"
  133 + })
  134 + }
  135 + //先获取是否有关闭使用优惠券
  136 + getApp().getConfig2(function (ee) {
  137 + //var json_d = JSON.parse(ee.switch_list);
  138 + //th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  139 + //th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  140 + th.show_page();
  141 + })
  142 + },
  143 +
  144 +
  145 + showInvoice: function() {
  146 + this.setData({
  147 + invoiceToggle: !this.data.invoiceToggle
  148 + });
  149 + },
  150 +
  151 +
  152 + //---------计算立即购买----------
  153 + calculatePrice2: function () {
  154 + console.log('calculatePrice2');
  155 + var th = this, good = this.data.bn_goods;
  156 + //-----------计算商品总价--------------
  157 + var allpice = good.shop_price * good.buynum;
  158 + allpice=parseFloat(allpice).toFixed(2);
  159 + var txt = "formData.all_price";
  160 + th.setData({ [txt]: allpice, });
  161 +
  162 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  163 + //-----------------总价-----------------
  164 + var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price);
  165 + total_m = parseFloat(total_m).toFixed(2);
  166 +
  167 + var atxt= "formData.total_amount";
  168 + th.setData({ [atxt]: total_m, })
  169 + var order_m = total_m;
  170 + var txt = "formData.user_money";
  171 + var txt2 = "formData.order_amount";
  172 +
  173 + th.setData({ [txt]: 0, [txt2]: order_m })
  174 +
  175 + },
  176 +
  177 + submitForm:function(){
  178 + var th=this;
  179 + this.sendsm(function(){
  180 + th.submit_func();
  181 + })
  182 + },
  183 +
  184 + //--------------------提交订单-----------------------
  185 + submit_func: async function(){
  186 + if(this.data.is_summit_ing==1) return false; //--提交中退出--
  187 + this.data.is_summit_ing=1;
  188 + var th=this,pdata=new Array();
  189 + var ff=true;
  190 + var item={
  191 + 'user_id': to.globalData.user_id,
  192 + 'account': th.data.formData.order_amount, //使用余额
  193 + 'store_id':oo.stoid, //商家
  194 + 'list':new Array(),
  195 + };
  196 + var gg = getApp().globalData.service_now;
  197 + var goods={
  198 + 'card_id': th.data.bn_goods.id,
  199 + 'itemid': th.data.bn_goods.erpItemID,
  200 + 'qty': gg.goods_num,
  201 + 'price': th.data.formData.order_amount,
  202 + 'pickup_id':gg.pick_id,
  203 + 'pickup_keyid':gg.keyid,
  204 + };
  205 +
  206 + //--导购分享过来的id--
  207 + if(gg.guide_id){
  208 + goods.guide_id=gg.guide_id;
  209 + goods.guide_type=gg.guide_type;
  210 + //调用接口判断是不是会员
  211 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  212 + if(res.data.code==0){
  213 + goods.guide_name=res.data.data.salesman;
  214 + goods.guide_sn=res.data.data.salesman_no;
  215 + }
  216 + })
  217 + }
  218 + item.list.push(goods);
  219 + pdata=item;
  220 +
  221 + var str = JSON.stringify(pdata);
  222 + console.log("支付数据");
  223 + console.log(str);
  224 + //return false;
  225 + wx.showLoading({title: "加载中"});
  226 + wx.request({
  227 + url: oo.url + '/api/weshop/recharge/saveRecharge',
  228 + data: str,
  229 + method: 'POST',
  230 + header: {
  231 + 'content-type': 'application/json'
  232 + },// 设置请求的 header
  233 + success: function (res) {
  234 +
  235 + wx.hideLoading();
  236 + if (res.statusCode == 200) {
  237 + var data=res.data;
  238 + if(data.code==0){
  239 +
  240 + var order_amount = pdata.account;
  241 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  242 + if (order_amount > 0) {
  243 + th.setData({ isclose: 0 });
  244 +
  245 + getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
  246 + data: {
  247 + parentSn: data.data.order_sn,
  248 + store_id: oo.stoid
  249 + },
  250 + success: function (su) {
  251 + var n=su.data.data;
  252 + th.weixinPay(n,
  253 + function () {
  254 + getApp().showWarning("购买成功");
  255 + setTimeout(function () {
  256 + wx.reLaunch({
  257 + url: "/packageA/pages/cardList/cardList",
  258 + })
  259 + },1000)
  260 + }, function () {
  261 + getApp().showWarning("支付失败");
  262 + setTimeout(function () {
  263 + wx.reLaunch({
  264 + url: "/packageA/pages/cardList/cardList",
  265 + })
  266 + },1000)
  267 + })
  268 + }
  269 + })
  270 + }
  271 + }
  272 + else{
  273 + th.data.is_summit_ing=0; //是否提交中
  274 + getApp().confirmBox(data.msg);
  275 + }
  276 + } else {
  277 + th.data.is_summit_ing=0; //是否提交中
  278 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  279 + }
  280 + },
  281 + fail: function () {
  282 + th.data.is_summit_ing=0; //是否提交中
  283 + wx.hideLoading();
  284 + console.log("index.js wx.request CheckCallUser fail");
  285 + },
  286 + complete: function () {}
  287 + })
  288 + },
  289 +
  290 + cart_set_err: function (e) {
  291 + var txt = e.currentTarget.dataset.err;
  292 + var ob = {};
  293 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  294 + this.setData(ob);
  295 + },
  296 +
  297 + //------调起支付框--------
  298 + weixinPay: function (n, success, fail) {
  299 + if(!n) return false;
  300 + wx.requestPayment({
  301 + timeStamp: String(n.timeStamp),
  302 + nonceStr: n.nonceStr,
  303 + package: n.packageValue,
  304 + signType: n.signType,
  305 + paySign: n.paySign,
  306 + success: function (n) {
  307 + console.log(n), getApp().showSuccess("支付成功!");
  308 + "function" == typeof success && success();
  309 + wx.redirectTo({
  310 + url: "../deposit/deposit"
  311 + });
  312 + },
  313 + fail: function (n) {
  314 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
  315 + "function" == typeof fail && fail();
  316 + }
  317 + });
  318 + },
  319 +
  320 + //订阅消息提醒
  321 + sendsm:function(func)
  322 + {
  323 + var template_id = this.data.template_id;
  324 + // //授权订阅
  325 + wx.requestSubscribeMessage({
  326 + tmplIds: [template_id],
  327 + success(res) {
  328 + func();
  329 + },
  330 + fail(res) {
  331 + func();
  332 + }
  333 + })
  334 +
  335 + },
  336 +
  337 +
  338 +});
packageA/pages/cart2_ser/cart2_ser.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "填写订单",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageA/pages/cart2_ser/cart2_ser.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +<form bindsubmit="submitForm">
  3 + <view class="container">
  4 +
  5 + <!------立即购买-------->
  6 + <block>
  7 + <view class="use-item bfff bdr_t-14 mgt20">
  8 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view>
  9 + <view class="order-detail">
  10 + <view class="goods-img">
  11 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}"
  12 + binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  13 + </view>
  14 + <navigator class="order-cont" url="/packageA/goodsInfo/goodsInfo?goods_id={{bn_goods.id}}">
  15 + <view class="goods-name ellipsis-2">{{bn_goods.serviceName}}</view>
  16 + <!-- 商品属性 -->
  17 + <!-- <view class="flex-vertical fs28 color-gray n_guige"> -->
  18 + <!-- <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></view> -->
  19 + <!-- </view> -->
  20 + <!-----商品名称规格------>
  21 + <view class="order-num flex-space-between">
  22 + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
  23 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  24 + </view>
  25 + </navigator>
  26 + </view>
  27 + </block>
  28 + <!--
  29 + <view class="coupon-mes flex-vertical">
  30 + <view>留言</view>
  31 + <view class="leave-word">
  32 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input>
  33 + </view>
  34 + </view>-->
  35 +
  36 + <view class="information bdr14">
  37 + <view class="item">
  38 + <view>服务卡金额</view>
  39 + <view class="co-red">¥ {{formData.all_price}}元</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="btn-wrap">
  44 + <view class="pay-amount">
  45 + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
  46 + </view>
  47 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  48 + </view>
  49 +</form>
  50 +<warn id="warn"></warn>
packageA/pages/cart2_ser/cart2_ser.wxss 0 → 100644
  1 +@import '../../../app.wxss';
  2 +
  3 +.bdr_t-14 {
  4 + border-top-left-radius: 14rpx;
  5 + border-top-right-radius: 14rpx;
  6 +}
  7 +.bdr_b-14 {
  8 + border-bottom-left-radius: 14rpx;
  9 + border-bottom-right-radius: 14rpx;
  10 +}
  11 +.bdr14 {
  12 + border-radius: 14rpx;
  13 +}
  14 +.mgt20 {
  15 + margin-top: 20rpx;
  16 +}
  17 +.shadow {
  18 + box-shadow: 0 4rpx 12px #e7e9eb;
  19 +}
  20 +.shadow-1 {
  21 + box-shadow: 16rpx 0px 12px #e7e9eb;
  22 +}
  23 +
  24 +
  25 +page {
  26 + /* background-color: #FAFAFA; */
  27 + background-color: #F0F0F0;
  28 + padding: 0 22rpx;
  29 + box-sizing: border-box;
  30 +}
  31 +.container {
  32 + background-color: #F0F0F0;
  33 + /* padding-top: 28rpx; */
  34 + padding-bottom: 120rpx;
  35 +}
  36 +.user-mes {
  37 + position: relative;
  38 + background-color: #fff;
  39 + font-size: 32rpx;
  40 + color: #444;
  41 + /* margin-top: 28rpx; */
  42 + border-radius: 14rpx;
  43 +}
  44 +.user-contact {
  45 + padding: 24rpx 26rpx;
  46 + font-weight: 600;
  47 +}
  48 +
  49 +.location {
  50 + position: relative;
  51 + padding: 0 70rpx 24rpx;
  52 +}
  53 +
  54 +.pos-icon {
  55 + position: absolute;
  56 + left: 28rpx;
  57 + top: 6rpx;
  58 + width: 30rpx;
  59 + height: 36rpx;
  60 +}
  61 +
  62 +.border-img {
  63 + width: 100%;
  64 + height: 12rpx;
  65 +}
  66 +
  67 +.update-logistics {
  68 + position: absolute;
  69 + right: 0;
  70 + top: 0;
  71 + width: 80rpx;
  72 + height: 100%;
  73 + display: flex;
  74 + align-items: center;
  75 + justify-content: center;
  76 +}
  77 +
  78 +.arrow-rigth {
  79 + width: 32rpx;
  80 + height: 32rpx;
  81 +}
  82 +
  83 +.order-meg {
  84 + margin-bottom: 20rpx;
  85 + font-size: 28rpx;
  86 +
  87 +}
  88 +
  89 +.order-detail {
  90 + padding: 30rpx 0;
  91 + border-bottom: 2rpx solid #eee;
  92 + color: #777;
  93 + min-height: 190rpx;
  94 + background-color: #fff;
  95 +
  96 +}
  97 +
  98 +.goods-img {
  99 + float: left;
  100 + width: 200rpx;
  101 + height: 200rpx;
  102 + margin: 0 20rpx;
  103 +}
  104 +
  105 +.order-cont {
  106 + float: left;
  107 + width: 438rpx;
  108 +}
  109 +
  110 +.goods-name {
  111 + height: 74rpx;
  112 + line-height: 40rpx;
  113 + overflow: hidden;
  114 + margin-bottom: 16rpx;
  115 + font-size: 28rpx;
  116 + color: #333;
  117 +}
  118 +
  119 +.goods-color {
  120 + font-size: 24rpx;
  121 +}
  122 +
  123 +.order-num {
  124 + margin-top: 25rpx;
  125 + font-size: 24rpx;
  126 + line-height: 42rpx;
  127 +}
  128 +
  129 +.set-mes{
  130 + background-color: #fff;
  131 + /* margin-top: 20rpx; */
  132 +}
  133 +.use-item{
  134 + display: flex;
  135 + align-items: center;
  136 + height: 80rpx;
  137 + /* border-bottom: 1px solid #ddd; */
  138 + font-size: 30rpx;
  139 + /* width:95%;
  140 +margin:auto; */
  141 + padding: 0 26rpx;
  142 +}
  143 +.use-item>view{
  144 + display: flex;
  145 + /* margin-right: 12rpx; */
  146 +}
  147 +.use-item.bfff{
  148 + background-color: #fff;
  149 +}
  150 +.use-item .dp{
  151 + display: block;
  152 + width: 50rpx;
  153 + height: 50rpx;
  154 + margin-left: -6rpx;
  155 +}
  156 +
  157 +.set-item {
  158 + justify-content: space-between;
  159 + background-color: #fff;
  160 +}
  161 +
  162 +.set-btn {
  163 + display: flex;
  164 + font-size: 24rpx;
  165 +}
  166 +
  167 +.set-mes input {
  168 + width: 380rpx;
  169 + height: 50rpx;
  170 + line-height: 50rpx;
  171 + border: 1px solid #ddd;
  172 +}
  173 +
  174 +.use-btn {
  175 + width: 100rpx;
  176 + height: 50rpx;
  177 + margin-left: 20rpx;
  178 + line-height: 50rpx;
  179 + text-align: center;
  180 + background-color: #f23030;
  181 + color: #fff;
  182 +}
  183 +
  184 +.coupon-mes {
  185 + /* box-sizing: border-box; */
  186 + height:95rpx;
  187 + padding: 0 26rpx;
  188 + background-color: #fff;
  189 + font-size: 30rpx;
  190 + color: #444;
  191 + /* width: 100%; */
  192 + border-radius: 14rpx;
  193 + margin-top: 20rpx;
  194 + margin-bottom: 20rpx;
  195 +}
  196 +
  197 +.coupon-title {
  198 + display: flex;
  199 + justify-content: space-between;
  200 + align-items: center;
  201 + height: 92rpx;
  202 +}
  203 +
  204 +.coupon-title>view {
  205 + display: flex;
  206 +}
  207 +
  208 +.coupon-num {
  209 + height: 36rpx;
  210 + margin-left: 20rpx;
  211 + padding: 0 16rpx;
  212 + line-height: 36rpx;
  213 + text-align: center;
  214 + background-color: #f23030;
  215 + color: #fff;
  216 + font-size: 24rpx;
  217 +}
  218 +
  219 +.leave-word {
  220 + position: relative;
  221 + font-size: 24rpx;
  222 + margin-left: 20rpx;
  223 + flex-grow: 1;
  224 +}
  225 +
  226 +.word-box {
  227 + font-size: 26rpx;
  228 + /* width: 600rpx; */
  229 + padding: 10rpx;
  230 + height: 28rpx;
  231 + line-height: 40rpx;
  232 +}
  233 +
  234 +.max-word {
  235 + position: absolute;
  236 + right: 0;
  237 + bottom: 0;
  238 +}
  239 +
  240 +.information {
  241 + padding: 0 26rpx;
  242 + background-color: #fff;
  243 + /* margin-bottom: 120rpx; */
  244 +}
  245 +
  246 +.information .item {
  247 + display: flex;
  248 + justify-content: space-between;
  249 + height: 60rpx;
  250 + line-height: 60rpx;
  251 + font-size: 26rpx;
  252 + color: #777;
  253 +}
  254 +
  255 +.btn-wrap {
  256 + height: 94rpx;
  257 + box-sizing: border-box;
  258 + display: flex;
  259 + justify-content: space-between;
  260 + background-color: white;
  261 + align-items: center;
  262 + position: fixed;
  263 + bottom: 0;
  264 + left: 0;
  265 + width: 100%;
  266 + padding: 0 30rpx;
  267 +}
  268 +
  269 +.tips-btn {
  270 + color: white;
  271 + background-color: #FE4445;
  272 + height: 72rpx;
  273 + line-height: 72rpx;
  274 + padding: 0 42rpx;
  275 + border-radius: 36rpx;
  276 + margin-left: 0;
  277 + margin-right: 0;
  278 +}
  279 +
  280 +.payable {
  281 + color: #444;
  282 +}
  283 +
  284 +.shipping-modal {
  285 + z-index: 20;
  286 + position: fixed;
  287 + bottom: 0;
  288 + left: 0;
  289 + right: 0;
  290 + overflow-y: hidden;
  291 + color: #666666;
  292 + background-color: white;
  293 +}
  294 +
  295 +.shipping-nav {
  296 + text-align: center;
  297 + font-size: 35rpx;
  298 + padding-top: 30rpx;
  299 +}
  300 +
  301 +.shipping-list {
  302 + padding: 20rpx 30rpx 40rpx;
  303 + font-size: 28rpx;
  304 +}
  305 +
  306 +.shipping-item {
  307 + display: block;
  308 + padding: 20rpx 0;
  309 +}
  310 +
  311 +.shipping-btn {
  312 + width: 100%;
  313 + color: white;
  314 + background-color: #f23030;
  315 + line-height: 90rpx;
  316 + text-align: center;
  317 + font-size: 40rpx;
  318 +}
  319 +
  320 +/*----------nyf新增,地址---------*/
  321 +.add_new{
  322 + height: 90rpx;
  323 + display: flex;
  324 + align-items: center;
  325 + padding: 0 26rpx;
  326 +}
  327 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  328 + margin-right: 15rpx;vertical-align: middle;}
  329 +.yu_er{
  330 + margin-left: 10rpx;
  331 + /* margin-right: 60rpx; */
  332 +}
  333 +.wuliu{margin-left: 20rpx;}
  334 +
  335 +
  336 +/*---- 优惠券列表 -----*/
  337 +.xc-coupon-frame{
  338 + width: 100%;
  339 + height: 92rpx;
  340 +
  341 +}
  342 +.xc-coupon-frame .work-frame{
  343 + width: 100%;
  344 + height: 100%;
  345 + border-bottom:3rpx solid #eee;
  346 + padding: 0 26rpx;
  347 + background-color: white;
  348 +}
  349 +.xc-right{
  350 + width:20rpx;
  351 + height:20rpx;
  352 + border-top:2rpx solid #000;
  353 + border-right:2rpx solid #000;
  354 + transform:rotate(45deg);
  355 + display:inline-block;
  356 +}
  357 +
  358 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  359 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  360 +
  361 +/* 自定义弹出窗口 */
  362 +.cx-popup{
  363 + width:100%;
  364 + height:880rpx;
  365 + background: #fff;
  366 + z-index: 35;
  367 + border-top-left-radius: 20rpx;
  368 + border-top-right-radius: 20rpx;
  369 + position:fixed;
  370 + bottom:0;
  371 + left: 0;
  372 + /* padding-bottom: 25rpx; */
  373 +}
  374 +
  375 +.cx-popup .top{
  376 + width:95%;
  377 + height:100rpx;
  378 + border-bottom:3rpx solid #ddd;
  379 + margin: auto;
  380 + margin-top: 30rpx;
  381 +
  382 +}
  383 +.xc-top-content{
  384 + width: 93%;
  385 + height:85rpx;
  386 + padding-top: 30rpx;
  387 + font-size: 34rpx;
  388 + font-weight: 600;
  389 +
  390 +}
  391 +
  392 +
  393 +.xc-valid-coupon{
  394 + width: 90%;
  395 + height:40rpx;
  396 + padding-top: 24rpx;
  397 + overflow: hidden;
  398 +}
  399 +.xc-frame{
  400 + width: 100%;
  401 + height:60%;
  402 +}
  403 +
  404 +.xc-frame .list-frame{
  405 + width: 95%;
  406 + height: 100%;
  407 + overflow-y:scroll;
  408 +
  409 +}
  410 +.xc-close-frame{
  411 + margin-top:-10rpx;
  412 +
  413 +}
  414 +
  415 +.xc-close{
  416 + width: 37rpx;
  417 +height: 37rpx;
  418 +border-radius: 50%;
  419 +border: 3rpx solid #333;
  420 +text-align: center;
  421 +line-height: 34rpx;
  422 +font-size: 29rpx;
  423 +color: #333;
  424 +
  425 +}
  426 +.xc-money{
  427 + color: #af2346;
  428 + font-size: 35rpx;
  429 +}
  430 +
  431 +.xc-money-frame{
  432 + margin-left:35rpx;
  433 +
  434 +}
  435 +.xc-coupon-effect{
  436 + width: 99%;
  437 + min-height: 100rpx;
  438 + border-bottom:3rpx solid #ddd;
  439 +
  440 +
  441 +}
  442 +.xc-goods-coupon{
  443 + width: 85%;
  444 + height:100%;
  445 +
  446 +}
  447 +.xc-title{
  448 + width:50%;
  449 + margin-left:222rpx;
  450 +
  451 +}
  452 +.xc-coupon-money0{
  453 + color: #c91e31;
  454 + font-size: 35rpx;
  455 + line-height: 40rpx;
  456 +
  457 +}
  458 +.xc-coupon-money{
  459 + color: #c91e31;
  460 + font-size: 35rpx;
  461 + line-height: 40rpx;
  462 + padding-top: 10px;
  463 +
  464 +}
  465 +.xc-coupon-money1{
  466 + color: #444;
  467 + font-size: 28rpx;
  468 + line-height: 60rpx;
  469 +
  470 +
  471 +}
  472 +.xc-coupon-time{
  473 + height: 50rpx;
  474 + font-size: 27rpx;
  475 + color: #a4a4a4;
  476 +}
  477 +.xc-coupon-time .time{
  478 + margin-left: 15rpx;
  479 + font-size: 27rpx;
  480 +}
  481 +.xc-coupon-selection{
  482 + height:100%;
  483 +}
  484 +
  485 +.xc-confirm {
  486 + width: 50%;
  487 + border-radius: 50rpx;
  488 + height: 80rpx;
  489 + margin:0 auto;
  490 + background:#d60021;
  491 + color:#fff;
  492 + font-size:28rpx;
  493 + margin-top: 28rpx;
  494 +}
  495 +
  496 +.up{ animation: up .7s; }
  497 +.down{ animation: down 1s; }
  498 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  499 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  500 +
  501 +.xc-not-Selection{
  502 + width: 40rpx;
  503 +height: 40rpx;
  504 + background: #eeeeee;
  505 +}
  506 +
  507 +
  508 +.xc-close-express{
  509 + width: 40rpx;
  510 +height: 40rpx;
  511 +border-radius: 50%;
  512 +border: 3rpx solid #333;
  513 +text-align: center;
  514 +font-size:32rpx;
  515 +line-height: 38rpx;
  516 +color: #333;
  517 +margin-top: 5rpx;
  518 +}
  519 +.cx-popup .tops{
  520 + width: 100%;
  521 +height: 145rpx;
  522 +border-bottom: 3rpx solid #eee;
  523 +
  524 +}
  525 +.top-content {
  526 + width: 82%;
  527 +padding-top: 33px;
  528 +height: 100%;
  529 +padding-left: 40rpx;
  530 +}
  531 +.close-frame{
  532 + margin-top: 30rpx;
  533 +
  534 +}
  535 +
  536 +.xc-hook {
  537 +width: 33rpx;
  538 +height: 33rpx;
  539 +transform: rotate(-135deg);
  540 +line-height: 35rpx;
  541 +text-align: center;
  542 +margin-right: 20rpx
  543 +
  544 +
  545 +}
  546 +.xc-hooks {
  547 +width: 30rpx;
  548 +height: 30rpx;
  549 +border: 1rpx solid #999;
  550 +margin-right: 20rpx;
  551 +}
  552 +.express_list_frame{
  553 + display: flex;
  554 +height: 80rpx;
  555 +align-items: center;
  556 +padding-left: 40rpx;
  557 +border-bottom: 1rpx solid #eee;
  558 +
  559 +}
  560 +.express_list{
  561 + width: 100%;
  562 + height: 65%;
  563 + overflow-y: auto;
  564 + margin-bottom: 40rpx;
  565 +
  566 +}
  567 +.xc-confirms {
  568 + box-sizing: border-box;
  569 + width: 40%;
  570 + border-radius: 50rpx;
  571 + height: 80rpx;
  572 + margin:0 auto;
  573 + font-size:28rpx;
  574 + background: #fff;
  575 + color: #333;
  576 + border: 2rpx solid #333;
  577 +}
  578 +
  579 +
  580 +/* 优惠券的改版样式 */
  581 +.xc-coupon-frame{
  582 + /* width: 710rpx; */
  583 + width: 100%;
  584 + height:auto;
  585 + margin: 0 auto;
  586 +
  587 +}
  588 +.xc-coupon-frame .coupon-frame{
  589 + width: 100%;
  590 + height: 200rpx;
  591 + margin-top:10rpx;
  592 + border-bottom: 1rpx solid #eee;
  593 +
  594 +}
  595 +.xc-coupon-frame .coupon-frame .coupon-left{
  596 + width: 215rpx;
  597 + height:100%;
  598 + overflow: hidden;
  599 +}
  600 +.xc-money-frames{
  601 + width:96%;
  602 + margin-top: -10px;
  603 +}
  604 +
  605 +.xc-rmb-symbol{
  606 + font-size:40rpx;
  607 +
  608 +}
  609 +
  610 +.xc-rmb-val{
  611 + font-size:60rpx;
  612 +
  613 +}
  614 +.coupon-explain{
  615 + font-size:25rpx;
  616 +width:100%;
  617 +
  618 +
  619 +}
  620 +.xc-valuer{
  621 + margin-top:39rpx;
  622 + margin-left:28rpx;
  623 + font-size:25rpx;
  624 +}
  625 +.coupon-frame .oval{
  626 + width:155rpx;
  627 + height:83rpx;
  628 + border-radius: 50%;
  629 + right:-78rpx;
  630 + top:-37rpx;
  631 +}
  632 +.coupon-right{
  633 + height: 99%;
  634 + border-top: 1rpx solid #eaeaea;
  635 + border-right: 1rpx solid #eaeaea;
  636 + flex-grow: 1;
  637 +}
  638 +.coupon-annotation{
  639 + width: 95%;
  640 + height: 100%;
  641 +
  642 +}
  643 +.xc-brand{
  644 + width:100rpx;
  645 + height:35rpx;
  646 + line-height: 35rpx;
  647 + font-size:21rpx;
  648 + border-radius:10rpx; position: relative; top:-1px;
  649 + margin-right: 8rpx
  650 +}
  651 +.top-frame{
  652 + width:82%;
  653 + height: 75rpx;
  654 + margin-top:10rpx;
  655 +}
  656 +.top-frame .coupon-wode{
  657 + font-size: 25rpx;
  658 + margin-left:10rpx;
  659 + width:340rpx;
  660 + height:88rpx;
  661 +}
  662 +.coupon-code{
  663 + width:60rpx;
  664 + height:60rpx;
  665 + margin-top:5rpx;
  666 +
  667 +}
  668 +.frame{
  669 + width: 100%
  670 +}
  671 +.coupon-time{
  672 + font-size: 23rpx;
  673 + line-height:33rpx;
  674 + color: #333;
  675 +}
  676 +
  677 +.clik-get{
  678 + width:125rpx;
  679 + height:45rpx;
  680 + border-radius: 25rpx;
  681 + line-height: 45rpx;
  682 + font-size:25rpx;
  683 + bottom:67rpx;
  684 + right:6px;
  685 +}
  686 +
  687 +.code-img{
  688 + margin-left:20rpx;
  689 +}
  690 +.bottmo-explain{
  691 +top:145rpx;
  692 +width:94%;
  693 +border-top:1rpx dashed #eee;
  694 +padding-top:8rpx;
  695 +height:38rpx;
  696 +line-height: 51rpx;
  697 +
  698 +}
  699 +.font-word{
  700 + font-size: 22rpx;
  701 +}
  702 +.circle-size{
  703 + background: #a0a0a0;
  704 + width: 27rpx;
  705 + height: 27rpx;
  706 + margin-top:13rpx;
  707 + margin-left:8rpx;
  708 + display: flex;
  709 + align-items: center;
  710 +}
  711 +.xc-jiantou{
  712 + transform: rotate(-90deg);
  713 + color: #fff;
  714 + font-size: 15rpx;
  715 + text-align: center;
  716 + width: 24rpx;
  717 +}
  718 +.xc-buttom{
  719 + box-sizing: border-box;
  720 + width:100%;
  721 + min-height:76rpx;
  722 + height:auto;
  723 + line-height:40rpx;
  724 + border-left:1rpx solid #eee;
  725 + border-right:1rpx solid #eee;
  726 + border-bottom:1rpx solid #eee;
  727 +}
  728 +
  729 +.goods-num{
  730 + font-size: 28rpx;
  731 + color: #333;
  732 +}
  733 +
  734 +.explain-coupon{
  735 + font-size:25rpx;
  736 + padding: 10rpx 10rpx
  737 +}
  738 +.circle-frame{
  739 + width: 20rpx;
  740 + height: auto;
  741 + z-index:1;
  742 + left:210rpx;
  743 +
  744 +}
  745 +.circle-sawtooth{
  746 + width: 11rpx;
  747 + height: 11rpx;
  748 + background: #fff;
  749 +}
  750 +
  751 +.red{background-color: #fe7496;}
  752 +.green{ background-color: #22c7c1;}
  753 +.blue{background-color:#5e82e3;}
  754 +.g_gray{background-color: #aaaaaa}
  755 +
  756 +.f_text{text-align: center; height:96rpx; }
  757 +.xc-hook.sn {
  758 + margin-top:12%;
  759 +width:45rpx;
  760 +height:45rpx;
  761 +font-size:28rpx;
  762 +line-height:44rpx;
  763 +
  764 +
  765 +}
  766 +.xc-hooks.on{
  767 + margin-top:12%;
  768 +width:42rpx;
  769 +height:42rpx;
  770 +}
  771 +.may_use_coupon{
  772 + /* width: 95%; */
  773 + /* height: 68rpx; */
  774 + line-height:78rpx;
  775 + padding: 0 26rpx;
  776 + justify-content: space-between;
  777 + align-items: center;
  778 +}
  779 +.determine-frame{
  780 + width: 100%;
  781 + height: 130rpx;
  782 +
  783 +}
  784 +.xc-determine{
  785 + height: 80rpx;
  786 + width: 40%;
  787 + border-radius: 50rpx;
  788 +background: #d60021;
  789 +color: #fff;
  790 +font-size: 28rpx;
  791 +margin: 0 auto;
  792 +
  793 +}
  794 +.click-buttem{
  795 +width: 90%;
  796 +margin: auto;
  797 +}
  798 +.logistics-name{
  799 + margin-right:20rpx;
  800 +}
  801 +.xc-border{
  802 + border-top:8rpx solid #eee;
  803 +width: 100%
  804 +}
  805 +.main-top{
  806 +margin-top: 20rpx;
  807 +
  808 +}
  809 +.xc-hookts{
  810 +border: 1rpx solid #999;
  811 +
  812 +}
  813 +.xc-hookts.on{
  814 + width:30rpx;
  815 +height:30rpx;
  816 +
  817 +}
  818 +.xc-hookt.sn{
  819 + width: 32rpx;
  820 +height: 32rpx;
  821 +font-size: 28rpx;
  822 +line-height: 34rpx;
  823 +}
  824 +.xc-hookt{
  825 + transform: rotate(-135deg);
  826 +text-align: center;
  827 +
  828 +}
  829 +.main-bottom{
  830 + margin-bottom: 20rpx;
  831 +
  832 +}
  833 +.xc-hookst{
  834 + border: 1rpx solid #999;
  835 +
  836 +}
  837 +.xc-hookst.ons{
  838 + width: 42rpx;
  839 +height: 42rpx;
  840 +margin-left: 20rpx;
  841 +
  842 +}
  843 +.is_use_coupon{
  844 + width: 65%;
  845 +justify-content: flex-end;
  846 +padding-top: 10rpx;
  847 +
  848 +
  849 +}
  850 +.xc-hooka{
  851 + transform: rotate(-135deg);
  852 +text-align: center;
  853 +
  854 +}
  855 +.xc-hooka.sn{
  856 + width: 45rpx;
  857 +height: 45rpx;
  858 +font-size: 28rpx;
  859 +line-height: 44rpx;
  860 +margin-left: 20rpx;
  861 +
  862 +}
  863 +.color-gray{
  864 + color: #808080;
  865 +}
  866 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  867 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  868 +
  869 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  870 +
  871 +.navigator-hover {
  872 + background: none;
  873 + opacity: 1;
  874 +}
  875 +
  876 +.plus_buy{
  877 + background-color: #fff;
  878 + margin:15rpx 0;
  879 + padding: 20rpx 10rpx;
  880 + position: relative;
  881 +}
  882 +
  883 +.card_bg {
  884 + box-sizing: border-box;
  885 + padding: 2rpx 10rpx;
  886 + height: 28rpx;
  887 + border-radius: 26rpx;
  888 + font-size: 18rpx;
  889 + line-height: 28rpx;
  890 + max-width: 210rpx;
  891 + background: #333;
  892 + color: #fff;
  893 + margin-left: 8rpx;
  894 + position:relative;
  895 + top:7rpx;
  896 +}
  897 +
  898 +.card_bg image {
  899 + width: 19rpx;
  900 + height: 19rpx;
  901 + margin-right: 8rpx;
  902 +}
  903 +
  904 +.card_name {
  905 + position: relative;
  906 + top: -4rpx;
  907 + margin-left: 6px;
  908 +}
  909 +
  910 +.car_tri_up {
  911 + width: 0;height: 0;
  912 + border-left: 20rpx solid transparent;
  913 + border-right: 20rpx solid transparent;
  914 + border-bottom: 20rpx solid #fff;
  915 + position: absolute;
  916 + right: 20rpx;
  917 + top:-10rpx
  918 +}
  919 +.card_op{
  920 + position: absolute;
  921 + right: 20rpx;
  922 + top:36rpx
  923 +}
  924 +
packageA/pages/chongzhiDetails/chongzhiDetails.js
@@ -217,6 +217,7 @@ Page({ @@ -217,6 +217,7 @@ Page({
217 217
218 //------调起支付框-------- 218 //------调起支付框--------
219 weixinPay: function (n, success, fail) { 219 weixinPay: function (n, success, fail) {
  220 + if(!n) return false;
220 wx.requestPayment({ 221 wx.requestPayment({
221 timeStamp: String(n.timeStamp), 222 timeStamp: String(n.timeStamp),
222 nonceStr: n.nonceStr, 223 nonceStr: n.nonceStr,
packageA/pages/distribution/card/card.js
@@ -49,7 +49,7 @@ Page({ @@ -49,7 +49,7 @@ Page({
49 var user_id=app.globalData.userInfo.user_id; 49 var user_id=app.globalData.userInfo.user_id;
50 // 请求数据 50 // 请求数据
51 wx.getImageInfo({ 51 wx.getImageInfo({
52 - src: os.url+'/api/wx/open/app/user/getWeAppEwm/1?sceneValue='+user_id+'&pageValue=packageA/pages/distribution/shop/shop', 52 + src: os.url+'/api/wx/open/app/user/getWeAppEwm/'+os.stoid+'?sceneValue='+user_id+'&pageValue=packageA/pages/distribution/shop/shop',
53 success (res) { 53 success (res) {
54 self.setData({ 54 self.setData({
55 img: res.path, 55 img: res.path,
packageA/pages/goodsInfo/goodsInfo.js
@@ -34,9 +34,7 @@ Page({ @@ -34,9 +34,7 @@ Page({
34 34
35 data: null, 35 data: null,
36 content: "", //商品详情 36 content: "", //商品详情
37 - comments: null, //商品评论  
38 - c_curr_p: 1, //评论分页  
39 - com_num: 0, //评论人数 37 +
40 gallery: null, //图片滚动 38 gallery: null, //图片滚动
41 is_collect: 0, 39 is_collect: 0,
42 collect_id: 0, 40 collect_id: 0,
@@ -45,8 +43,7 @@ Page({ @@ -45,8 +43,7 @@ Page({
45 optionItemId: 0, 43 optionItemId: 0,
46 goodsInputNum: 1, 44 goodsInputNum: 1,
47 openSpecModal: !1, 45 openSpecModal: !1,
48 - openSpecModal_pt: !1, //拼单的弹起,  
49 - openPromModal: !1, 46 +
50 activeCategoryId: 0, 47 activeCategoryId: 0,
51 supportPageScroll: !1, 48 supportPageScroll: !1,
52 address: { 49 address: {
@@ -108,15 +105,13 @@ Page({ @@ -108,15 +105,13 @@ Page({
108 activity: null 105 activity: null
109 }, 106 },
110 107
111 - //已选的商品(属性)  
112 - sele_g_spec_name: '',  
113 - sele_g_id: '',  
114 - sele_g: null, 108 +
115 //门店相关 109 //门店相关
116 ismend: 0, 110 ismend: 0,
117 is_sec_mend: 0, 111 is_sec_mend: 0,
118 sto_sele_name: "", //选中的门店名称 112 sto_sele_name: "", //选中的门店名称
119 sto_sele_id: "", //选中的门店id 113 sto_sele_id: "", //选中的门店id
  114 + sto_sele_keyid:'', //选中的门店线下
120 sto_sele_distr: "", //选择的门店的配送方式 115 sto_sele_distr: "", //选择的门店的配送方式
121 is_show_sto_cat: 1, //是否显示门店分类 116 is_show_sto_cat: 1, //是否显示门店分类
122 only_pk: null, 117 only_pk: null,
@@ -127,44 +122,17 @@ Page({ @@ -127,44 +122,17 @@ Page({
127 sec_pick_index: 0, //第二级门店选择ID 122 sec_pick_index: 0, //第二级门店选择ID
128 fir_pick_index: 0, //第一级门店选择ID 123 fir_pick_index: 0, //第一级门店选择ID
129 all_pick_list:null,//所有的门店先记录起来 124 all_pick_list:null,//所有的门店先记录起来
130 - //同一条形码的所有商品  
131 - sku_g: null,  
132 - sku_g_pt: null, //---拼单的普通购买--- 125 +
133 //联系电话 126 //联系电话
134 mobile: '', 127 mobile: '',
135 - //分类,品牌,国别名称  
136 - cat_name: '',  
137 - brand_name: '',  
138 - nation_name: '',  
139 -  
140 //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单 128 //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单
141 - prom_type: 0,  
142 - prom_time_text: "",  
143 - prom_price: null,  
144 - prom_buy_limit: 0,  
145 - djs: null,  
146 - prom_st: 0,  
147 - prom_r_null: 0,  
148 - prom_end_time: null,  
149 - prom_start_time: null,  
150 - prom_act: null,  
151 - pd_xx: 0,  
152 - is_normal: 0, //是否普通购买  
153 - teamgroup: null, //有多少人开团  
154 - grounp_tatal: 0, //有几个人开团  
155 timer: [], 129 timer: [],
156 130
157 //商品的购买次数 131 //商品的购买次数
158 prom_buy_num: -1, 132 prom_buy_num: -1,
159 g_buy_num: null, 133 g_buy_num: null,
160 - prom_goods_num: 0, //活动商品数量  
161 - prom_buy_num: 0, //活动商品购买数量  
162 - prom_redis_num: 0, //活动商品redis数量  
163 -  
164 - //拼单的规则显示  
165 - is_show_gz: 0, 134 +
166 //会员自己的购买的拼单商品的情况 135 //会员自己的购买的拼单商品的情况
167 - user_order_pt_state: 0,  
168 //购买的订单 136 //购买的订单
169 buy_order: null, 137 buy_order: null,
170 //1加入购物车 2立即购买 138 //1加入购物车 2立即购买
@@ -175,11 +143,6 @@ Page({ @@ -175,11 +143,6 @@ Page({
175 isshow: 0, 143 isshow: 0,
176 bconfig: null, //基础配置 144 bconfig: null, //基础配置
177 145
178 - fir_comments: null, //详情页上的评价  
179 - fir_quan: null, //详情页上的券  
180 - quan_list: null, //券列表  
181 -  
182 - coupon: 0,  
183 //会员分享的头像 146 //会员分享的头像
184 share_head: "", 147 share_head: "",
185 share_goods_img: "", 148 share_goods_img: "",
@@ -189,15 +152,6 @@ Page({ @@ -189,15 +152,6 @@ Page({
189 swiperCurrent: 0, //轮播的下标 152 swiperCurrent: 0, //轮播的下标
190 hiddenn: 0, //控制轮播计数显示 153 hiddenn: 0, //控制轮播计数显示
191 154
192 - currentTab: 0, // 选择器控制参数  
193 - mapurl: "",  
194 - mapurl_f_img: "",  
195 - videopicture: 0, //视频图片的控制  
196 -  
197 - video: 0, //视频图片切换器  
198 - index: 0,  
199 - noon: 0, //开始视频的隐藏  
200 -  
201 screenWidth: 0, 155 screenWidth: 0,
202 canvasHidden: 1, 156 canvasHidden: 1,
203 157
@@ -208,8 +162,6 @@ Page({ @@ -208,8 +162,6 @@ Page({
208 is_show_gb: 0, //是否国别 162 is_show_gb: 0, //是否国别
209 is_closecoupon: 0, 163 is_closecoupon: 0,
210 164
211 - //是否点赞中  
212 - iszaning: 0,  
213 165
214 select_store: 0, //选择更多 166 select_store: 0, //选择更多
215 index: 1, 167 index: 1,
@@ -230,51 +182,42 @@ Page({ @@ -230,51 +182,42 @@ Page({
230 default_store: {}, //创建添加默认门店地址的对象 182 default_store: {}, //创建添加默认门店地址的对象
231 183
232 comments_no_more:0, 184 comments_no_more:0,
233 - get_c:0, //获取评价是不是成 185 +
234 is_collect_load:0, //是不是处理 186 is_collect_load:0, //是不是处理
235 is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存 187 is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存
236 sales_rules:1, //默认是线上销售 188 sales_rules:1, //默认是线上销售
237 189
238 wait_for_user_store:null, 190 wait_for_user_store:null,
239 - prom_goods:null, //商品优惠列表  
240 - order_prom:null, //订单优惠  
241 - collocationGoods:null, //搭配购  
242 -  
243 poster:null, //自定义海报 191 poster:null, //自定义海报
244 - share_b_img:'', //自定义分享的背景  
245 - 192 + share_b_img:'', //自定义分享的背景
246 showPoster: false, 193 showPoster: false,
247 hui_condition:null, 194 hui_condition:null,
248 sto_sele_name_1:'',//分享的门店名称 195 sto_sele_name_1:'',//分享的门店名称
249 - 196 +
250 }, 197 },
251 198
252 //------初始化加载---------- 199 //------初始化加载----------
253 onLoad: function(t) { 200 onLoad: function(t) {
254 - // wx.setNavigationBarTitle({  
255 - // title: "商品详情",  
256 - // }) 201 +
  202 + console.log("--服务卡项--");
  203 + console.log(t);
  204 +
257 var ee = this, 205 var ee = this,
258 that = ee, 206 that = ee,
259 th = ee, 207 th = ee,
260 gid = t.goods_id, 208 gid = t.goods_id,
261 - first_leader=t.first_leader,  
262 - room_id=t.room_id,  
263 - room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id  
264 - 209 + first_leader=t.first_leader;
  210 +
265 //-- 自定义海报 -- 211 //-- 自定义海报 --
266 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 212 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
267 data:{store_id:os.stoid, type:1, is_use:1} 213 data:{store_id:os.stoid, type:1, is_use:1}
268 }).then(res=>{ 214 }).then(res=>{
269 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){  
270 - 215 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){
271 var poster_data=res.data.data.pageData[0]; 216 var poster_data=res.data.data.pageData[0];
272 - var json_str=poster_data.jsonStr;  
273 - 217 + var json_str=poster_data.jsonStr;
274 if(json_str){ 218 if(json_str){
275 var json_data=JSON.parse(json_str); 219 var json_data=JSON.parse(json_str);
276 - if(json_data.bg_img){  
277 - 220 + if(json_data.bg_img){
278 //-- 把图片那到本地 -- 221 //-- 把图片那到本地 --
279 wx.getImageInfo({ 222 wx.getImageInfo({
280 src:json_data.bg_img, 223 src:json_data.bg_img,
@@ -285,8 +228,7 @@ Page({ @@ -285,8 +228,7 @@ Page({
285 fail: function(res) {} 228 fail: function(res) {}
286 }); 229 });
287 } 230 }
288 - th.setData({poster:json_data})  
289 - 231 + th.setData({poster:json_data})
290 } 232 }
291 } 233 }
292 }) 234 })
@@ -308,9 +250,7 @@ Page({ @@ -308,9 +250,7 @@ Page({
308 250
309 } 251 }
310 ee.setData({ gid: gid}); 252 ee.setData({ gid: gid});
311 - if(first_leader){  
312 - console.log("log---".first_leader);  
313 - 253 + if(first_leader){
314 getApp().globalData.first_leader=first_leader; 254 getApp().globalData.first_leader=first_leader;
315 //调用接口判断是不是会员 255 //调用接口判断是不是会员
316 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ 256 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
@@ -319,16 +259,6 @@ Page({ @@ -319,16 +259,6 @@ Page({
319 } 259 }
320 }) 260 })
321 } 261 }
322 -  
323 - //-- 如果有房间号 --  
324 - if(room_id){  
325 - getApp().globalData.room_id=room_id;  
326 - getApp().globalData.room_goods_id=gid;  
327 - //如果是会员分享过来的要记录  
328 - if(room_user_share)  
329 - getApp().globalData.room_user_share=room_user_share;  
330 - }  
331 -  
332 var c_guide_id=t.c_guide_id; 262 var c_guide_id=t.c_guide_id;
333 if(c_guide_id){ 263 if(c_guide_id){
334 th.data.c_guide_id=c_guide_id; 264 th.data.c_guide_id=c_guide_id;
@@ -340,75 +270,19 @@ Page({ @@ -340,75 +270,19 @@ Page({
340 270
341 //----获取系统参数----- 271 //----获取系统参数-----
342 getApp().getConfig2(function(e) { 272 getApp().getConfig2(function(e) {
343 - ee.setData({  
344 - bconfig: e,  
345 - sales_rules:e.sales_rules,  
346 - });  
347 -  
348 - if (e.categoryset.indexOf("," + 1 + ",") != -1) {  
349 - ee.setData({  
350 - is_show_pl: 1  
351 - });  
352 - }  
353 - if (e.categoryset.indexOf("," + 3 + ",") != -1) {  
354 - ee.setData({  
355 - is_show_pp: 1  
356 - });  
357 - }  
358 - if (e.categoryset.indexOf("," + 2 + ",") != -1) {  
359 - ee.setData({  
360 - is_show_gb: 1  
361 - });  
362 - }  
363 - 273 +
364 var json_d = JSON.parse(e.switch_list); 274 var json_d = JSON.parse(e.switch_list);
365 ee.setData({ 275 ee.setData({
366 store_config: e, 276 store_config: e,
367 sys_switch:json_d, 277 sys_switch:json_d,
368 - is_closecoupon: json_d.is_closecoupon,  
369 - is_newsales_rules:json_d.is_newsales_rules  
370 }); 278 });
371 - ee.init(gid);  
372 - //------几人评价-------  
373 - //n.init(th, "", "comments");  
374 - 279 +
  280 +
375 th.requestCardNum(), wx.pageScrollTo && th.setData({ 281 th.requestCardNum(), wx.pageScrollTo && th.setData({
376 supportPageScroll: !0 282 supportPageScroll: !0
377 }); 283 });
378 284
379 - //计算等级价相关  
380 - var swithc_list=e.switch_list;  
381 - var sw_arr=JSON.parse(swithc_list);  
382 - //---如果后台又开等级卡的开关---  
383 - if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){  
384 - th.setData({rank_switch:true});  
385 - //---回调卡的列表---  
386 - th.getPlusCardType(function(ob){  
387 - th.setData({card_list:ob.card_list});  
388 - var ti = setInterval(function () {  
389 - var user = getApp().globalData.userInfo;  
390 - if (!user) return false;  
391 - clearInterval(ti);  
392 -  
393 - if(user.card_field && user['card_expiredate']){  
394 - var str = user['card_expiredate'].replace(/-/g, '/');  
395 - var end = new Date(str);  
396 - end = Date.parse(end) / 1000;  
397 - var now = ut.gettimestamp();  
398 - //--- 判断是等级会员,且在有效期范围内 ---  
399 - if(user.card_field && now<end){  
400 - var card_name=ob.name_map.get(user.card_field);  
401 - if(card_name.length>6) card_name=card_name.substring(0,6);  
402 -  
403 - var is_near_date=0;  
404 - if(end-now<60*60*30*24) is_near_date=1; //如果小于30天  
405 - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date});  
406 - }  
407 - }  
408 - }, 500)  
409 - })  
410 - }  
411 - 285 +
412 },1); 286 },1);
413 287
414 //获取用户设备信息,屏幕宽度 288 //获取用户设备信息,屏幕宽度
@@ -429,13 +303,11 @@ Page({ @@ -429,13 +303,11 @@ Page({
429 var ee=JSON.parse(JSON.stringify(e)); 303 var ee=JSON.parse(JSON.stringify(e));
430 //--定时器推迟一下-- 304 //--定时器推迟一下--
431 setTimeout(function () { 305 setTimeout(function () {
432 - if(th.data.data) var g_distr_type=th.data.data.distr_type;  
433 - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--  
434 - if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){  
435 - //th.data.fir_def_store={}; //赋值空对象  
436 - //return false;  
437 - //th.data.fir_def_store.is_no_dis=1;  
438 - ee.is_no_dis=1; 306 + if(!th.data.data) return false;
  307 + var ser_card=th.data.data;
  308 + //--如果默认门店不在等级卡的默认们店以内
  309 + if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
  310 + ee.is_no_dis=1;
439 } 311 }
440 312
441 var appd=getApp().globalData; 313 var appd=getApp().globalData;
@@ -454,7 +326,8 @@ Page({ @@ -454,7 +326,8 @@ Page({
454 def_pick_store: e, 326 def_pick_store: e,
455 sto_sele_name: e.pickup_name, 327 sto_sele_name: e.pickup_name,
456 sto_sele_id: e.pickup_id, 328 sto_sele_id: e.pickup_id,
457 - sto_sele_distr: e.distr_type 329 + sto_sele_distr: e.distr_type,
  330 + sto_sele_keyid:e.keyid,
458 }) 331 })
459 }else{ 332 }else{
460 //要用接口是获取距离,js的计算不准 333 //要用接口是获取距离,js的计算不准
@@ -471,7 +344,8 @@ Page({ @@ -471,7 +344,8 @@ Page({
471 def_pick_store: e, 344 def_pick_store: e,
472 sto_sele_name: e.pickup_name, 345 sto_sele_name: e.pickup_name,
473 sto_sele_id: e.pickup_id, 346 sto_sele_id: e.pickup_id,
474 - sto_sele_distr: e.distr_type 347 + sto_sele_distr: e.distr_type,
  348 + sto_sele_keyid:e.keyid,
475 }) 349 })
476 } 350 }
477 351
@@ -491,7 +365,8 @@ Page({ @@ -491,7 +365,8 @@ Page({
491 def_pick_store: e, 365 def_pick_store: e,
492 sto_sele_name: e.pickup_name, 366 sto_sele_name: e.pickup_name,
493 sto_sele_id: e.pickup_id, 367 sto_sele_id: e.pickup_id,
494 - sto_sele_distr: e.distr_type 368 + sto_sele_distr: e.distr_type,
  369 + sto_sele_keyid:e.keyid,
495 }) 370 })
496 } 371 }
497 } 372 }
@@ -501,186 +376,21 @@ Page({ @@ -501,186 +376,21 @@ Page({
501 }); 376 });
502 377
503 }, 378 },
504 -  
505 //------------程序初始化入口------------- 379 //------------程序初始化入口-------------
506 - async init(gid) {  
507 - var ee = this,  
508 - th = ee,  
509 - gallery = null,  
510 - is_collect = 0,  
511 - collect_id = 0,  
512 - categories3 = ee.data.categories3,  
513 - fir_com = null,  
514 - fir_quan = null,  
515 - mapurl = null,  
516 - mapurl_f_img = null;  
517 -  
518 -  
519 - //------图片滚动----------  
520 - await getApp().request.promiseGet("/api/weshop/goodsimages/page", {  
521 - data: {  
522 - store_id: os.stoid,  
523 - goods_id: gid,  
524 - },  
525 - }).then(res => {  
526 -  
527 - var t = res;  
528 - var g = t.data.data.pageData;  
529 - if (g.length == 0) {  
530 - var ie = {  
531 - "image_url": o.imghost + "/public/images/default_goods_image_240.gif"  
532 - };  
533 - g.push(ie);  
534 - gallery = g;  
535 - return;  
536 - }  
537 - for (var i = 0; i < g.length; i++) {  
538 - if (g[i].image_url.indexOf(o.imghost) == -1)  
539 - g[i].image_url = o.imghost + g[i].image_url;  
540 - }  
541 - gallery = g;  
542 - })  
543 - //------是否收藏----------  
544 - await getApp().request.promiseGet("/api/weshop/goodscollect/page", {  
545 - data: {  
546 - store_id: os.stoid,  
547 - goods_id: gid,  
548 - user_id: oo.user_id,  
549 - }  
550 - }).then(res => {  
551 - var t = res;  
552 - var data = t.data.data.pageData;  
553 - if (data.length > 0) {  
554 - //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, });  
555 - is_collect = 1;  
556 - collect_id = data[0].collect_id;  
557 - }  
558 - })  
559 -  
560 - //------获取评价的统计数量----  
561 - await getApp().request.promiseGet("/api/weshop/comment/countlist/", {  
562 - data: {  
563 - store_id: os.stoid,  
564 - goods_id: gid  
565 - },  
566 - //failRollback: !0,  
567 -  
568 - }).then(res => {  
569 - var t = res;  
570 - var g = t.data.data[0];  
571 - if (g != null && g != undefined) {  
572 - var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5;  
573 - var num2 = g.c4 + g.c5;  
574 - var num3 = g.c3;  
575 - var num4 = g.c0 + g.c1 + g.c2;  
576 -  
577 - var dd = ee.data.categories3;  
578 - dd[0].num = allnum;  
579 - dd[1].num = g.cimg;  
580 - dd[2].num = num2;  
581 - dd[3].num = num3;  
582 - dd[4].num = num4;  
583 -  
584 - categories3 = dd;  
585 - }  
586 - })  
587 -  
588 - //----获取详情页的评价----  
589 - await getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
590 - data: {  
591 - store_id: os.stoid,  
592 - goods_id: gid,  
593 - pageSize: 3,  
594 - parent_id: 0,  
595 - page:1,  
596 - is_show:1,  
597 - },  
598 - }).then(res => {  
599 - fir_com = res.data.data.pageData;  
600 - })  
601 -  
602 - if (fir_com) {  
603 - for (var ind in fir_com) {  
604 - if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";  
605 - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);  
606 - if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);  
607 - }  
608 - }  
609 -  
610 - if (th.data.is_closecoupon != 1) {  
611 - //----获取详情页的券的数量----  
612 - await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {  
613 - data: {  
614 - store_id: os.stoid,  
615 - type: 1,  
616 - pageSize: 3,  
617 - page: 1,  
618 - is_share:0,  
619 - },  
620 - }).then(res1 => {  
621 - fir_quan = res1.data.data.pageData;  
622 - })  
623 - }  
624 -  
625 - //--------获取视频图片---------  
626 - // await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {  
627 - // 1: 1  
628 - // }).then(res1 => {  
629 - // if (res1.data.code == 0) {  
630 - // mapurl = res1.data.data.video_url;  
631 - // mapurl_f_img = res1.data.data.video_img;  
632 - // }  
633 - // })  
634 -  
635 - ee.setData({  
636 - gallery: gallery,  
637 - is_collect: is_collect,  
638 - collect_id: collect_id,  
639 - categories3: categories3,  
640 - fir_quan: fir_quan,  
641 - fir_comments: fir_com,  
642 - mapurl_f_img: mapurl_f_img,  
643 - mapurl: mapurl,  
644 - });  
645 -  
646 - }, 380 + async init(gid) {},
647 381
648 //---展示--- 382 //---展示---
649 onShow: function() { 383 onShow: function() {
650 - var goods_list = null,th = this,that=this;  
651 -  
652 - //优惠券要实时更新  
653 - getApp().getConfig2(function(e) {  
654 - var json_d = JSON.parse(e.switch_list);  
655 - th.setData({is_closecoupon: json_d.is_closecoupon})  
656 - th.setData({is_open_offline: json_d.is_pricing_open})  
657 - },1)  
658 -  
659 -  
660 - var ui = setInterval(function () {  
661 - goods_list = th.selectComponent("#goods_list");  
662 - if (goods_list) {  
663 - clearInterval(ui);  
664 - goods_list.init();  
665 - return false  
666 - }  
667 - }, 300)  
668 - 384 + var that=this;
669 this.data.is_timer = 1; 385 this.data.is_timer = 1;
670 - var ee = this,  
671 - gid = this.data.gid,  
672 - i = getApp().request;  
673 -  
674 - this.wait_for_store_config(); 386 + var ee = this,gid = this.data.gid, i = getApp().request;
  387 + this.wait_for_store_config();
675 388
676 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { 389 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
677 failRollback: !0, 390 failRollback: !0,
678 success: function(t) { 391 success: function(t) {
679 if (t.data.code == 0) { 392 if (t.data.code == 0) {
680 - console.log('xx==><==', t.data.data);  
681 - // let data = {  
682 - // goods_name: t.data.data.serviceName,  
683 - // }; 393 +
684 that.setData({ 394 that.setData({
685 'data.goods_name': t.data.data.serviceName, 395 'data.goods_name': t.data.data.serviceName,
686 'data.shop_price': t.data.data.money, 396 'data.shop_price': t.data.data.money,
@@ -688,188 +398,28 @@ Page({ @@ -688,188 +398,28 @@ Page({
688 'data.serviceContent': t.data.data.serviceContent, 398 'data.serviceContent': t.data.data.serviceContent,
689 'data.image_url': t.data.data.imgUrl, 399 'data.image_url': t.data.data.imgUrl,
690 'data.goods_id': t.data.data.id, 400 'data.goods_id': t.data.data.id,
691 - });  
692 - // self.setData({  
693 - // details: t.data.data,  
694 - // data,  
695 - // });  
696 - // if (t.data.data.is_on_sale != 1) {  
697 - // wx.showModal({  
698 - // title: '商品已经下架',  
699 - // showCancel: !1,  
700 - // complete: function() {  
701 - // wx.navigateBack();  
702 - // }  
703 - // });  
704 - // }  
705 -  
706 - // var timestamp = Date.parse(new Date());  
707 - // timestamp = timestamp / 1000;  
708 - // if (t.data.data.on_time > timestamp) {  
709 - // wx.showModal({  
710 - // title: '商品还未上架',  
711 - // showCancel: !1,  
712 - // complete: function() {  
713 - // wx.navigateBack();  
714 - // }  
715 - // });  
716 - // }  
717 -  
718 - // if (t.data.data.down_time > 0) {  
719 - // if (t.data.data.down_time < timestamp) {  
720 - // wx.showModal({  
721 - // title: '商品已经到期下架',  
722 - // showCancel: !1,  
723 - // complete: function() {  
724 - // wx.navigateBack();  
725 - // }  
726 - // });  
727 - // }  
728 - // }  
729 -  
730 - // ee.check_is_youhui(ee.data.gid);  
731 -  
732 - // t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');  
733 - // var txt = (t.data.data.shop_price / t.data.data.market_price * 10).toFixed(2).toString();  
734 -  
735 -  
736 - // if(txt != 0) {  
737 - // if(txt.indexOf('.') != -1) {  
738 - // var arrtxt = txt.split('.');  
739 - // if(arrtxt[1].length == 1 && arrtxt[1][0] == 0) {  
740 - // txt = txt.slice(0,-2);  
741 - // };  
742 -  
743 - // if(arrtxt[1].length == 2 && arrtxt[1][1] == 0) {  
744 - // txt = txt.slice(0,-1);  
745 - // };  
746 - // };  
747 - // } else {  
748 - // txt = 0;  
749 - // } 401 + 'data.id': t.data.data.id,
  402 + 'data.sales_sum': t.data.data.sales_sum,
  403 + 'data.storageId':t.data.data.storageId
  404 + });
  405 +
750 406
  407 + //-----商品详情---
  408 + if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
  409 + a.wxParse("content", "html", t.data.data.serviceContent, ee, 6);
  410 + e.wxParseAddFullImageUrl(ee, "content");
  411 +
  412 + //获取重表
  413 + getApp().promiseGet("/api/weshop/serviceItem/list",{
  414 + data:{store_id:o.stoid,service_id:t.data.data.id}
  415 + }).then(res=>{
  416 + if(res.data.code==0){
  417 + var list=res.data.data;
  418 + that.setData({service_list:list})
  419 + }
  420 + })
751 421
752 - // t.data.data['disc'] = txt;  
753 -  
754 - // if (t.data.data.original_img.indexOf(o.imghost) == -1)  
755 - // t.data.data.original_img = o.imghost + t.data.data.original_img;  
756 -  
757 - // if (t.data.data.goods_content == null) t.data.data.goods_content = "";  
758 -  
759 - // //-----商品详情---  
760 - // if(!t.data.data.goods_content) t.data.data.goods_content=" ";  
761 - // a.wxParse("content", "html", t.data.data.goods_content, ee, 6);  
762 - // e.wxParseAddFullImageUrl(ee, "content");  
763 -  
764 - // ee.setData({  
765 - // data: t.data.data,  
766 - // sele_g: t.data.data,  
767 - // userInfo:getApp().globalData.userInfo  
768 - // });  
769 -  
770 -  
771 - // //获取统一条形码,普通商品和优惠促销的商品  
772 - // if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5){  
773 - // //默认门店要拿下门店库存  
774 - // if(that.data.sales_rules==2 && that.data.is_newsales_rules){  
775 - // //获取门店  
776 - // ee.get_sto();  
777 - // //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存  
778 - // getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){  
779 - // if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){  
780 - // var lock=0,plist=null;  
781 - // //先读取门店的lock,采用链式写法,少用await  
782 - // getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
783 - // data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}  
784 - // }).then(res=>{  
785 - // if(res.data.code==0 && res.data.data.total>0){  
786 - // for(var i in res.data.data.pageData)  
787 - // lock+=res.data.data.pageData[i].outQty  
788 - // }  
789 - // //---通过接口获取门店的线下库存信息--  
790 - // return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
791 - // data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}  
792 - // })  
793 - // }).then(res=>{  
794 - // if(res.data.code==0 && res.data.data.total>0){  
795 - // plist=res.data.data.pageData[0];  
796 - // }  
797 - // if(plist && plist.CanOutQty-lock>0){  
798 - // that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;  
799 - // }else{  
800 - // that.data.fir_def_store.CanOutQty=0;  
801 - // }  
802 - // //--给门店赋值线下库存--  
803 - // th.setData({def_pick_store:that.data.fir_def_store});  
804 - // })  
805 - // }  
806 - // })  
807 - // }else{  
808 - // //获取门店  
809 - // ee.get_sto();  
810 - // }  
811 -  
812 - // ee.get_sku(o.stoid, t.data.data.sku, gid);  
813 - // }  
814 - // else {  
815 - // var gg = "", item = t.data.data;  
816 -  
817 - // if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";  
818 - // if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";  
819 -  
820 - // if (item.goods_spec != "" && item.goods_color != "") {  
821 - // gg = item.goods_spec + "/" + item.goods_color;  
822 - // } else if (item.goods_spec != "" || item.goods_color != "") {  
823 - // gg = item.goods_spec + item.goods_color;  
824 - // } else {  
825 - // gg = "规格1";  
826 - // }  
827 - // t.data.data.gg = gg;  
828 - // var uu = [];  
829 - // uu.push(t.data.data);  
830 - // ee.setData({  
831 - // sku_g: uu,  
832 - // });  
833 - // }  
834 - // ee.data.g_buy_num = new Map();  
835 - // ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id);  
836 -  
837 - // var th = ee;  
838 - // if (ee.data.cat_name == '') {  
839 - // //过去国别,分类,品牌的名称  
840 - // i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {  
841 - // success: function(t) {  
842 - // var dd = t.data.data;  
843 - // if (t.data.code == 0) {  
844 - // th.setData({  
845 - // cat_name: dd.name  
846 - // });  
847 - // }  
848 - // }  
849 - // });  
850 - // //过去国别,分类,品牌的名称  
851 - // i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {  
852 - // success: function(t) {  
853 - // var dd = t.data.data;  
854 - // if (t.data.code == 0) {  
855 - // th.setData({  
856 - // brand_name: dd.name  
857 - // });  
858 - // }  
859 - // }  
860 - // });  
861 - // //过去国别,分类,品牌的名称  
862 - // i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {  
863 - // success: function(t) {  
864 - // var dd = t.data.data;  
865 - // if (t.data.code == 0) {  
866 - // th.setData({  
867 - // nation_name: dd.name  
868 - // });  
869 - // }  
870 - // }  
871 - // });  
872 - // } 422 +
873 423
874 } else { 424 } else {
875 wx.showModal({ 425 wx.showModal({
@@ -883,6 +433,7 @@ Page({ @@ -883,6 +433,7 @@ Page({
883 } 433 }
884 }); 434 });
885 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 435 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
  436 + this.get_sto();
886 437
887 }, 438 },
888 enterAddress: function() { 439 enterAddress: function() {
@@ -890,6 +441,7 @@ Page({ @@ -890,6 +441,7 @@ Page({
890 url: "/pages/user/address_list/address_list?operate=selectAddress" 441 url: "/pages/user/address_list/address_list?operate=selectAddress"
891 }); 442 });
892 }, 443 },
  444 +
893 onUnload: function() { 445 onUnload: function() {
894 for(var i = 1; i < 100; i++) { 446 for(var i = 1; i < 100; i++) {
895 clearInterval(i); 447 clearInterval(i);
@@ -945,811 +497,102 @@ Page({ @@ -945,811 +497,102 @@ Page({
945 this.setData({ 497 this.setData({
946 activeCategoryId: 1 498 activeCategoryId: 1
947 }); 499 });
948 -  
949 - if (th.data.cat_name == '') {  
950 - //过去国别,分类,品牌的名称  
951 - i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {  
952 - success: function(t) {  
953 - var dd = t.data.data;  
954 - if (t.data.code == 0) {  
955 - th.setData({  
956 - cat_name: dd.name  
957 - });  
958 - }  
959 - }  
960 - });  
961 - //过去国别,分类,品牌的名称  
962 - i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {  
963 - success: function(t) {  
964 - var dd = t.data.data;  
965 - if (t.data.code == 0) {  
966 - th.setData({  
967 - brand_name: dd.name  
968 - });  
969 - }  
970 - }  
971 - });  
972 - //过去国别,分类,品牌的名称  
973 - i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {  
974 - success: function(t) {  
975 - var dd = t.data.data;  
976 - if (t.data.code == 0) {  
977 - th.setData({  
978 - nation_name: dd.name  
979 - });  
980 - }  
981 - }  
982 - });  
983 - }  
984 - },  
985 -  
986 - //获取redis中的数量  
987 - async getactLen(func) {  
988 - var r_num = 0,  
989 - prom_type = this.data.prom_type,  
990 - prom_id = this.data.prom_id;  
991 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
992 - 1: 1  
993 - }).then(res => {  
994 - var em = res;  
995 - if (em.data.code == 0) {  
996 - r_num = em.data.data;  
997 - }  
998 - })  
999 - func(r_num);  
1000 }, 500 },
1001 501
  502 +
1002 //------------加入购物车-------------- 503 //------------加入购物车--------------
1003 addCart: function(t) { 504 addCart: function(t) {
1004 var th = this; 505 var th = this;
1005 var ind = t.currentTarget.dataset.openSpecModal_ind; 506 var ind = t.currentTarget.dataset.openSpecModal_ind;
  507 + var action= t.currentTarget.dataset.action;
1006 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 508 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
1007 - th.setData({ 509 +
  510 + th.setData({
1008 open_ind_store: ind 511 open_ind_store: ind
1009 }); 512 });
1010 - //如果是秒杀的话,要看redis够不够  
1011 - if (this.data.prom_type == 1) {  
1012 - this.getactLen(function(num) {  
1013 - if (num < th.data.goodsInputNum) {  
1014 - getApp().my_warnning("秒杀库存不足!", 0, th);  
1015 - return false;  
1016 - } else {  
1017 - th.add_cart_func(t);  
1018 - }  
1019 - });  
1020 - } else {  
1021 - th.add_cart_func(t);  
1022 - }  
1023 - },  
1024 -  
1025 -  
1026 -  
1027 - //-- 加入购物的函数 --  
1028 - add_cart_func_inte: function(t) {  
1029 - var i = getApp().request;  
1030 - if (oo.user_id == null) {  
1031 - return s.my_warnning("还未登录!", 0, this);  
1032 - }  
1033 - if(!getApp().globalData.userInfo){  
1034 - return s.my_warnning("还未登录!", 0, this);  
1035 - }  
1036 -  
1037 - var e = this,  
1038 - th = e,  
1039 - a = 0,  
1040 - o = this.data.data;  
1041 - a = o.goods_id;  
1042 -  
1043 - //----------添加到购物车时,要判断限购数量,--------  
1044 - e.get_buy_num(o, function(ee) {  
1045 - //---判断商品是否超出限购---  
1046 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1047 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
1048 - wx.showModal({  
1049 - title: '提示',  
1050 - content: '超出商品限购'  
1051 - });  
1052 - return false;  
1053 - }  
1054 - }  
1055 - //---判断商品是否超出活动限购---  
1056 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1057 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1058 - wx.showModal({  
1059 - title: '提示',  
1060 - content: '超出商品活动限购'  
1061 - });  
1062 - return false;  
1063 - }  
1064 - }  
1065 -  
1066 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
1067 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
1068 - this.setData({  
1069 - sto_sele_name: ""  
1070 - });  
1071 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
1072 -  
1073 - //--------------此时操作的数据------------  
1074 - var newd = {  
1075 - goods_id: o.goods_id,  
1076 - goods_num: th.data.goodsInputNum,  
1077 - pick_id: th.data.sto_sele_id,  
1078 - user_id: oo.user_id,  
1079 - store_id: th.data.stoid,  
1080 - goods_price: th.data.prom_price,  
1081 - integral:th.data.prom_integral,  
1082 - member_goods_price: o.shop_price,  
1083 - goods_name: o.goods_name,  
1084 - goods_sn: o.goods_sn,  
1085 - sku: o.sku,  
1086 - };  
1087 -  
1088 - //---是不是从收藏夹出来的---  
1089 - if(th.data.c_guide_id){  
1090 - newd['guide_id'] = th.data.c_guide_id;  
1091 - newd['guide_type']=2;  
1092 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1093 - }else{  
1094 - if(getApp().globalData.guide_id){  
1095 - newd['guide_id'] = getApp().globalData.guide_id;  
1096 - newd['guide_type']=0;  
1097 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;  
1098 - }  
1099 - }  
1100 -  
1101 - //让商品带上房间号  
1102 - //让商品带上房间号  
1103 - if(th.data.sys_switch.is_skuroom_id==1){  
1104 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1105 - newd.room_id=getApp().globalData.room_id;  
1106 - }  
1107 - }else{  
1108 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;  
1109 - }  
1110 -  
1111 - //如果是积分够,is_integral_normal就要有积分购普通购买字段  
1112 - if(o.prom_type==4){  
1113 - newd.is_integral_normal=1;  
1114 - }  
1115 -  
1116 - //-----如果是秒杀,团购,积分购,拼团-----  
1117 - newd.prom_type = th.data.prom_type;  
1118 - newd.prom_id = th.data.prom_id;  
1119 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1120 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1121 -  
1122 -  
1123 - th.add_cart_next(e,t,a,o,newd); //立即购买下一步  
1124 -  
1125 - })  
1126 - },  
1127 -  
1128 - //-- 加入购物的函数 --  
1129 - add_cart_func: function(t) {  
1130 - var i = getApp().request;  
1131 - if (oo.user_id == null) {  
1132 - return s.my_warnning("还未登录!", 0, this);  
1133 - }  
1134 513
1135 - if(!getApp().globalData.userInfo){  
1136 - return s.my_warnning("还未登录!", 0, this); 514 + if(action=="buy"){
  515 + //--------------此时操作的数据------------
  516 + var newd = {
  517 + id: th.data.data.id,
  518 + goods_num: th.data.goodsInputNum,
  519 + pick_id: th.data.sto_sele_id,
  520 + keyid: th.data.sto_sele_keyid,
  521 + };
  522 + newd['pick_name'] = th.data.sto_sele_name;
  523 + newd['guide_id'] = getApp().globalData.guide_id;
  524 + newd['guide_type']=0;
  525 +
  526 + th.buyNow(newd);
1137 } 527 }
1138 528
1139 - var e = this,  
1140 - th = e,  
1141 - a = 0,  
1142 - o = this.data.sele_g;  
1143 - a = o.goods_id;  
1144 -  
1145 - //----------添加到购物车时,要判断限购数量,--------  
1146 - e.get_buy_num(o, function(ee) {  
1147 - //---判断商品是否超出限购---  
1148 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1149 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
1150 - wx.showModal({  
1151 - title: '提示',  
1152 - content: '超出商品限购'  
1153 - });  
1154 - return false;  
1155 - }  
1156 - }  
1157 - //---判断商品是否超出活动限购---  
1158 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1159 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1160 - wx.showModal({  
1161 - title: '提示',  
1162 - content: '超出商品活动限购'  
1163 - });  
1164 - return false;  
1165 - }  
1166 - }  
1167 -  
1168 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
1169 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
1170 - this.setData({  
1171 - sto_sele_name: ""  
1172 - });  
1173 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
1174 -  
1175 - //--------------此时操作的数据------------  
1176 - var newd = {  
1177 - goods_id: o.goods_id,  
1178 - goods_num: th.data.goodsInputNum,  
1179 - pick_id: th.data.sto_sele_id,  
1180 - user_id: oo.user_id,  
1181 - store_id: th.data.stoid,  
1182 - goods_price: o.shop_price,  
1183 - member_goods_price: o.shop_price,  
1184 - goods_name: o.goods_name,  
1185 - goods_sn: o.goods_sn,  
1186 - sku: o.sku,  
1187 - };  
1188 529
1189 - //---是不是从收藏夹出来的---  
1190 - if(th.data.c_guide_id){  
1191 - newd['guide_id'] = th.data.c_guide_id;  
1192 - newd['guide_type']=2;  
1193 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1194 - }else{  
1195 - if(getApp().globalData.guide_id){  
1196 - newd['guide_id'] = getApp().globalData.guide_id;  
1197 - newd['guide_type']=0;  
1198 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;  
1199 - }  
1200 - }  
1201 -  
1202 - //让商品带上房间号  
1203 - //让商品带上房间号  
1204 - if(th.data.sys_switch.is_skuroom_id==1){  
1205 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1206 - newd.room_id=getApp().globalData.room_id;  
1207 - }  
1208 - }else{  
1209 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;  
1210 - }  
1211 -  
1212 - //如果是积分够,is_integral_normal就要有积分购普通购买字段  
1213 - if(o.prom_type==4){  
1214 - newd.is_integral_normal=1;  
1215 - }  
1216 -  
1217 - //如果有线下取价  
1218 - if(o.offline_price){  
1219 - newd.offline_price=o.offline_price;  
1220 - newd.pricing_type=o.pricing_type;  
1221 - }  
1222 -  
1223 - //-----如果是秒杀,团购,积分购,拼团-----  
1224 - if (th.data.prom_type == 1) {  
1225 - newd.goods_price = th.data.prom_price;  
1226 - newd.member_goods_price = th.data.prom_price,  
1227 - newd.prom_type = th.data.prom_type;  
1228 - newd.prom_id = th.data.prom_id;  
1229 -  
1230 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1231 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); 530 + },
  531 +
  532 + //----------立即购买-----------
  533 + buyNow: function(e) {
  534 + getApp().globalData.service_now=e;
  535 + wx.redirectTo({
  536 + url: "/packageA/pages/cart2_ser/cart2_ser",
  537 + });
  538 + },
  539 + //----------增加购买数量-----------
  540 + addCartNum: function(t) {
  541 + this.checkCartNum(this.data.goodsInputNum + 1);
  542 + },
  543 + //----------减少购买数量-----------
  544 + subCartNum: function(t) {
  545 + this.checkCartNum(this.data.goodsInputNum - 1);
  546 + },
  547 + //----------输入框输入购买数量-----------
  548 + inputCartNum: function(t) {
  549 + this.checkCartNum(Number(t.detail.value));
  550 + },
1232 551
1233 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步 552 + //------检查数量是不是超出限购------
  553 + checkCartNum: function(t) {
  554 + if(t<=0) return false;
  555 + var th = this;
  556 + th.setData({goodsInputNum:t})
  557 + },
1234 558
1235 - }  
1236 - else if ( th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) {  
1237 - newd.prom_type = 0;  
1238 - newd.prom_id = 0;  
1239 559
1240 - //---如果是线下门店销售的时候---  
1241 - if(th.data.sales_rules==2){  
1242 - var pick=th.get_pick_from_list(th.data.sto_sele_id)  
1243 - //---通过接口获取门店的线下库存信息--  
1244 - getApp().request.get("/api/weshop/goods/getWareStorages",{  
1245 - data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},  
1246 - success:function(res){  
1247 - if(res.data.code==0){  
1248 - if(res.data.data.pageData.length>0){  
1249 - var CanOutQty=res.data.data.pageData[0].CanOutQty;  
1250 - if(CanOutQty<e.data.goodsInputNum){  
1251 - return s.my_warnning("库存不足!", 0, th);  
1252 - }  
1253 - //在调一次接口,读取商品的预出库的数量,lock  
1254 - getApp().request.get("/api/weshop/order/ware/lock/page",{  
1255 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},  
1256 - success:function(res_data){  
1257 - if(res_data.data.code==0 && res_data.data.data.total>0){ 560 + closeSpecModal: function() {
  561 + this.setData({
  562 + openSpecModal: !1,
  563 + openSpecModal_pt: !1
  564 + });
  565 + },
  566 +
  567 + openSpecModel: function(t) {
  568 + var th=this;
  569 + var open_store = t.currentTarget.dataset.ind;
  570 + this.setData({
  571 + store: 0,
  572 + choice_sort_store: 0,
  573 + sort_store: 0,
  574 + open_ind_store: open_store,
  575 + })
  576 + //--先判断会员状态--
  577 + var user_info = getApp().globalData.userInfo;
  578 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  579 + wx.navigateTo({
  580 + url: '/pages/togoin/togoin',
  581 + })
  582 + return false;
  583 + }
1258 584
1259 - var lock=0;  
1260 - for(var i in res_data.data.data.pageData){  
1261 - lock+=res_data.data.data.pageData[i].outQty;  
1262 - } 585 + var ind = t.currentTarget.dataset.ind;
  586 + this.setData({
  587 + openSpecModal: !0,
  588 + openSpecModal_ind: ind,
  589 + });
1263 590
1264 - if(CanOutQty<=lock){  
1265 - return s.my_warnning("库存不足!", 0, th);  
1266 - }  
1267 - th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);  
1268 - }else{  
1269 - th.add_cart_next(e,t,a,o,newd,CanOutQty);  
1270 - }  
1271 - }  
1272 - })  
1273 - }else{  
1274 - return s.my_warnning("库存不足!", 0, th);  
1275 - }  
1276 -  
1277 - }  
1278 - }  
1279 - })  
1280 - }else{  
1281 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1282 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1283 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步  
1284 - }  
1285 - }  
1286 - })  
1287 - },  
1288 -  
1289 - //---加入购物车的最后一步---  
1290 - add_cart_next(e,t,a,o,newd,CanOutQty){  
1291 - var th=this,i=getApp().request;  
1292 - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------  
1293 - if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){  
1294 - var conf=th.data.bconfig;  
1295 - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']){  
1296 - var s_list=JSON.parse(conf.switch_list);  
1297 - var now=ut.gettimestamp();  
1298 -  
1299 -  
1300 - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');  
1301 - var end = new Date(str);  
1302 - end = Date.parse(end) / 1000;  
1303 -  
1304 - //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下--  
1305 - if(parseInt(s_list.rank_switch)==2 && end>now){  
1306 - var card_price=o[getApp().globalData.userInfo['card_field']];  
1307 - //如果会员有等级价  
1308 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
1309 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
1310 - newd.goods_price=card_price;  
1311 - newd.member_goods_price=card_price;  
1312 - }  
1313 - }  
1314 - }  
1315 - }  
1316 -  
1317 - //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);  
1318 - if ("add" == t.currentTarget.dataset.action) {  
1319 -  
1320 - if(th.data.prom_goods){  
1321 - newd.prom_type = 3;  
1322 - newd.prom_id = th.data.prom_goods[0].prom_id;  
1323 - }  
1324 -  
1325 - //----先看会员在购物车中是否加入了该商品-----  
1326 - i.get("/api/weshop/cart/page", {  
1327 - data: {  
1328 - store_id: e.data.stoid,  
1329 - user_id: oo.user_id,  
1330 - goods_id: a,  
1331 - pick_id: e.data.sto_sele_id,  
1332 - },  
1333 - success: function(re) {  
1334 -  
1335 - //-------如果购物车中有相关的数据---------  
1336 - if (re.data.data.total > 0) {  
1337 -  
1338 - var item = re.data.data.pageData[0];  
1339 -  
1340 - //判断数量,要看下购物车中有没有该商品  
1341 - if(CanOutQty){  
1342 - if(item.goods_num+ th.data.goodsInputNum>CanOutQty){  
1343 - return s.my_warnning("库存不足!", 0, th);  
1344 - }  
1345 - }else{  
1346 - if(item.goods_num+ th.data.goodsInputNum>o.store_count){  
1347 - return s.my_warnning("库存不足!", 0, th);  
1348 - }  
1349 - }  
1350 -  
1351 - var updata = {  
1352 - id: item.id,  
1353 - goods_num: e.data.goodsInputNum + item.goods_num,  
1354 - goods_price: newd.goods_price,  
1355 - member_goods_price:newd.goods_price,  
1356 - store_id: th.data.stoid,  
1357 - };  
1358 -  
1359 - //---是不是从收藏夹出来的---  
1360 - if(th.data.c_guide_id){  
1361 - updata['guide_id'] = th.data.c_guide_id;  
1362 - updata['guide_type']=3; //加入购物车之后就变成了3  
1363 - }else {  
1364 - if (getApp().globalData.guide_id) {  
1365 - updata['guide_id'] = getApp().globalData.guide_id;  
1366 - updata['guide_type'] = 0;  
1367 - }  
1368 - }  
1369 -  
1370 - i.put("/api/weshop/cart/update", {  
1371 - data: updata,  
1372 - success: function(t) {  
1373 - getApp().my_warnning('加入购物车成功', 1, th, 450);  
1374 - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;  
1375 - th.setData({  
1376 - cartGoodsNum: c_num  
1377 - });  
1378 - th.closeSpecModal();  
1379 - }  
1380 - });  
1381 - } else {  
1382 -  
1383 -  
1384 - i.post("/api/weshop/cart/save", {  
1385 - data: newd,  
1386 - success: function(t) {  
1387 - getApp().my_warnning('加入购物车成功', 1, th, 450);  
1388 - var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;  
1389 - th.setData({  
1390 - cartGoodsNum: c_num  
1391 - });  
1392 - th.closeSpecModal();  
1393 - }  
1394 - });  
1395 - }  
1396 - }  
1397 - });  
1398 - }  
1399 - //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d);  
1400 - else {  
1401 -  
1402 - if(th.data.prom_goods){  
1403 - var prom_d=th.data.prom_goods;  
1404 - for(var i in prom_d){  
1405 - //判断活动有俩种条件,0元 1件  
1406 - var condition_t=prom_d[i].prom_type;  
1407 - switch(condition_t) {  
1408 - case 0: //按钱  
1409 - if(newd.goods_price>=condition_t){  
1410 - newd.prom_type = 3;  
1411 - newd.prom_id = prom_d[i].prom_id;  
1412 - }  
1413 - break  
1414 - case 1://按购买数量  
1415 - if(newd.goods_num>=condition_t){  
1416 - newd.prom_type = 3;  
1417 - newd.prom_id = prom_d[i].prom_id;  
1418 - }  
1419 - break;  
1420 - }  
1421 - }  
1422 -  
1423 - }  
1424 -  
1425 - newd['pick_name'] = th.data.sto_sele_name;  
1426 - newd['pick_dis'] = th.data.sto_sele_distr;  
1427 - th.buyNow(newd);  
1428 - }  
1429 - },  
1430 -  
1431 -  
1432 - //----------购买虚拟商品------  
1433 - buyVirtualGoods: function(e) {  
1434 - Object.assign(e, {  
1435 - goods_name: this.data.data.goods.goods_name,  
1436 - spec_name: this.data.select.specName,  
1437 - price: this.data.select.price  
1438 - }), wx.navigateTo({  
1439 - url: "/pages/virtual/buy_step/buy_step?" + t.Obj2Str(e)  
1440 - });  
1441 - },  
1442 - //----------积分兑换---------  
1443 - exchange: function(e) {  
1444 - this.data.shippingCost < 0 || this.data.select.stock <= 0 || wx.navigateTo({  
1445 - url: "/pages/cart/integral/integral?" + t.Obj2Str(e)  
1446 - });  
1447 - },  
1448 -  
1449 -  
1450 - //----------立即购买-----------  
1451 - buyNow: function(e) {  
1452 - // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {  
1453 - // action: "buy_now"  
1454 - // }),  
1455 - s.set_b_now(e);  
1456 - if(e.prom_type==4){  
1457 - var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;  
1458 - getApp().goto(url);  
1459 - }else{  
1460 - wx.redirectTo({  
1461 - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,  
1462 - });  
1463 - }  
1464 - },  
1465 -  
1466 - //----------增加购买数量-----------  
1467 - addCartNum: function(t) {  
1468 - this.checkCartNum(this.data.goodsInputNum + 1);  
1469 - },  
1470 - //----------减少购买数量-----------  
1471 - subCartNum: function(t) {  
1472 - this.checkCartNum(this.data.goodsInputNum - 1);  
1473 - },  
1474 - //----------输入框输入购买数量-----------  
1475 - inputCartNum: function(t) {  
1476 - this.checkCartNum(Number(t.detail.value));  
1477 - },  
1478 -  
1479 - //----------增加购买数量-----------  
1480 - addCartNum_inte: function(t) {  
1481 - this.checkCartNum_inte(this.data.goodsInputNum + 1);  
1482 - },  
1483 - //----------减少购买数量-----------  
1484 - subCartNum_inte: function(t) {  
1485 - this.checkCartNum_inte(this.data.goodsInputNum - 1);  
1486 - },  
1487 - //----------输入框输入购买数量-----------  
1488 - inputCartNum_inte: function(t) {  
1489 - this.checkCartNum_inte(Number(t.detail.value));  
1490 - },  
1491 -  
1492 -  
1493 - //------检查数量是不是超出限购------  
1494 - checkCartNum: function(t) {  
1495 - var th = this;  
1496 - this.data.sele_g = this.data.data;  
1497 - this.get_buy_num(this.data.sele_g, async function() {  
1498 - // this.get_buy_num(this.data.sele_g, async function() {  
1499 -  
1500 - //--判断商品是否超出限购--  
1501 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1502 -  
1503 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);  
1504 -  
1505 - if (t + gd_buy_num > th.data.sele_g.viplimited) {  
1506 - wx.showModal({  
1507 - title: '超出商品限购',  
1508 - });  
1509 -  
1510 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1511 - if(num<0) num=0;  
1512 - th.setData({goodsInputNum:num})  
1513 - return false;  
1514 - }  
1515 - }  
1516 -  
1517 - //--判断商品是否超出活动限购--  
1518 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {  
1519 - if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1520 - wx.showModal({  
1521 - title: '超出商品活动限购',  
1522 - });  
1523 -  
1524 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1525 - if(num<0) num=0;  
1526 - th.setData({goodsInputNum:num})  
1527 - return false;  
1528 - }  
1529 - }  
1530 -  
1531 - if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {  
1532 - var redis_num = 0;  
1533 - //------判断活动是否抢光-----  
1534 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
1535 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {  
1536 - 1: 1  
1537 - }).then(res => {  
1538 - redis_num = res.data.data;  
1539 - });  
1540 -  
1541 - if (t > redis_num) {  
1542 - wx.showModal({  
1543 - title: '超出商品活动库存',  
1544 - });  
1545 - th.setData({goodsInputNum:redis_num})  
1546 - return false;  
1547 - }  
1548 -  
1549 - }  
1550 -  
1551 - var e = th.data.sele_g.store_count;  
1552 - if(th.data.sales_rules==2){  
1553 - if(!th.data.def_pick_store){  
1554 - wx.showModal({ title: '请选择门店', });  
1555 - return false;  
1556 - }else{  
1557 - e=th.data.def_pick_store.CanOutQty;  
1558 - }  
1559 - }  
1560 -  
1561 - //库存不足,不增加  
1562 - if(e<t){ wx.showModal({ title: '库存不足', });  
1563 - if(e<0) e=0;  
1564 - th.setData({ goodsInputNum: e }); return false;  
1565 - }  
1566 - t > e || 0 == e ? t = e : t < 1 && (t = 1);  
1567 - th.setData({ goodsInputNum: t });  
1568 - th.is_show_more_buy();  
1569 -  
1570 - })  
1571 - },  
1572 -  
1573 - //----- 检查一下积分购的限购之类的问题 -----  
1574 - checkCartNum_inte: function(t) {  
1575 - var th = this;  
1576 - this.get_buy_num(this.data.data, async function() {  
1577 -  
1578 - //--判断商品是否超出限购--  
1579 - if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {  
1580 -  
1581 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);  
1582 -  
1583 - if (t + gd_buy_num > th.data.sele_g.viplimited) {  
1584 - wx.showModal({  
1585 - title: '超出商品限购',  
1586 - });  
1587 -  
1588 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1589 - if(num<0) num=0;  
1590 - th.setData({goodsInputNum:num})  
1591 - return false;  
1592 - }  
1593 - }  
1594 -  
1595 - //--判断商品是否超出活动限购--  
1596 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1597 - if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1598 - wx.showModal({  
1599 - title: '超出商品活动限购',  
1600 - });  
1601 -  
1602 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1603 - if(num<0) num=0;  
1604 - th.setData({goodsInputNum:num})  
1605 - return false;  
1606 - }  
1607 - }  
1608 -  
1609 - if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {  
1610 - var redis_num = 0;  
1611 - //------判断活动是否抢光-----  
1612 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
1613 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {  
1614 - 1: 1  
1615 - }).then(res => {  
1616 - redis_num = res.data.data;  
1617 - });  
1618 -  
1619 - if (t > redis_num) {  
1620 - wx.showModal({  
1621 - title: '超出商品活动库存',  
1622 - });  
1623 - th.setData({goodsInputNum:redis_num})  
1624 - return false;  
1625 - }  
1626 -  
1627 - }  
1628 -  
1629 - var e = th.data.sele_g.store_count;  
1630 - if(th.data.sales_rules==2){  
1631 - if(!th.data.def_pick_store){  
1632 - wx.showModal({ title: '请选择门店', });  
1633 - return false;  
1634 - }else{  
1635 - e=th.data.def_pick_store.CanOutQty;  
1636 - }  
1637 - }  
1638 -  
1639 - //库存不足,不增加  
1640 - if(e<t){ wx.showModal({ title: '库存不足', });  
1641 - if(e<0) e=0;  
1642 - th.setData({ goodsInputNum: e }); return false;  
1643 - }  
1644 - t > e || 0 == e ? t = e : t < 1 && (t = 1);  
1645 - th.setData({ goodsInputNum: t });  
1646 - })  
1647 - },  
1648 -  
1649 -  
1650 - closeSpecModal: function() {  
1651 - if(this.data.openSpecModal_pt && this.data.is_normal){  
1652 - this.get_sto();  
1653 - }  
1654 -  
1655 - this.setData({  
1656 - openSpecModal: !1,  
1657 - openSpecModal_pt: !1  
1658 - });  
1659 - },  
1660 -  
1661 - openSpecModel: function(t) {  
1662 - var th=this;  
1663 - var open_store = t.currentTarget.dataset.ind;  
1664 - this.setData({  
1665 - store: 0,  
1666 - choice_sort_store: 0,  
1667 - sort_store: 0,  
1668 - open_ind_store: open_store,  
1669 - })  
1670 - //--先判断会员状态--  
1671 - var user_info = getApp().globalData.userInfo;  
1672 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
1673 - wx.navigateTo({  
1674 - url: '/pages/togoin/togoin',  
1675 - })  
1676 - return false;  
1677 - }  
1678 -  
1679 - var ind = t.currentTarget.dataset.ind;  
1680 - this.setData({  
1681 - openSpecModal: !0,  
1682 - openSpecModal_ind: ind,  
1683 - });  
1684 -  
1685 - var is_open=th.data.config  
1686 -  
1687 -  
1688 - this.get_off_price();  
1689 -  
1690 - },  
1691 -  
1692 - //----获取线下价格-------  
1693 - get_off_price(){  
1694 - var th=this;  
1695 - //没有开启就返回  
1696 - if(!th.data.is_open_offline) return false;  
1697 - //先看下购买的功能有没有到期  
1698 - getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=6",{}).then(res=>{  
1699 - //未购买  
1700 - if(res.data.code!=0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length){  
1701 - return false;  
1702 - }else{  
1703 - //已经过期  
1704 - var item=res.data.data.pageData[0];  
1705 - if(item.end_time<ut.gettimestamp()){  
1706 - return false;  
1707 - }  
1708 - }  
1709 -  
1710 -  
1711 - var cur_goods=this.data.sele_g;  
1712 - var cur_price=cur_goods.shop_price;  
1713 - if(th.data.card_field && cur_goods[th.data.card_field]>0){  
1714 - cur_price=cur_goods[th.data.card_field];  
1715 - }  
1716 -  
1717 - var user_info = getApp().globalData.userInfo;  
1718 - //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行  
1719 - if(cur_goods.prom_type==0 && !this.data.prom_goods){  
1720 - cur_goods.offline_price=null;  
1721 - //如果没有门店,不用计算线下价格  
1722 - var def_pick_store=this.data.def_pick_store;  
1723 - if(!def_pick_store) return false;  
1724 - getApp().request.get("/api/weshop/goods/listWarePrice", {  
1725 - data:{VIPId:encodeURIComponent(user_info.erpvipid),  
1726 - store_id:os.stoid,  
1727 - PickupId:def_pick_store.pickup_id,  
1728 - WareIds:encodeURIComponent(cur_goods.erpwareid)},  
1729 - success:function(res){  
1730 - if(res.data.code==0 && res.data.data && res.data.data.length>0){  
1731 - var datalist=res.data.data;  
1732 - if(datalist[0].WarePrice<cur_price){  
1733 - cur_goods.offline_price=datalist[0].WarePrice; //存储线下活动的价格  
1734 - cur_goods.pricing_type=datalist[0].PriceType; //存储线下活动的类型  
1735 - }  
1736 - }  
1737 - th.setData({sele_g:cur_goods});  
1738 - }  
1739 -  
1740 - })  
1741 - }  
1742 -  
1743 - })  
1744 -  
1745 -  
1746 }, 591 },
1747 592
1748 -  
1749 //---------点击收藏和不收藏------------ 593 //---------点击收藏和不收藏------------
1750 collectGoods: function() { 594 collectGoods: function() {
1751 - var t = this,  
1752 - i = getApp().request; 595 + var t = this,i = getApp().request;
1753 var user_id = s.globalData.user_id; 596 var user_id = s.globalData.user_id;
1754 if (user_id == '') { 597 if (user_id == '') {
1755 getApp().getUserFir(function() {}); 598 getApp().getUserFir(function() {});
@@ -1845,56 +688,10 @@ Page({ @@ -1845,56 +688,10 @@ Page({
1845 } 688 }
1846 }); 689 });
1847 }, 690 },
1848 -  
1849 - previewCommentImgs: function(t) {  
1850 - var e = this.data.comments[t.currentTarget.dataset.cidx].img;  
1851 - var b = e.slice()  
1852 - for(var i in b){  
1853 - b[i] = this.data.iurl + e[i];  
1854 - }  
1855 -  
1856 - wx.previewImage({  
1857 - current: b[t.currentTarget.dataset.id],  
1858 - urls: b  
1859 - });  
1860 - },  
1861 -  
1862 - previewCommentImgs_w: function(t) {  
1863 - var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;  
1864 - var b = e.slice()  
1865 - for (var i in b) {  
1866 - b[i] = this.data.iurl + e[i];  
1867 - }  
1868 - wx.previewImage({  
1869 - current: b[t.currentTarget.dataset.id],  
1870 - urls: b  
1871 - });  
1872 - },  
1873 -  
1874 - previewGoodsCommentImgs: function(t) {  
1875 - var e = this,  
1876 - a = this.data.data.comment[t.currentTarget.dataset.cidx].img;  
1877 - a = a.map(function(t) {  
1878 - return e.data.url + t;  
1879 - }), wx.previewImage({  
1880 - current: a[t.currentTarget.dataset.id],  
1881 - urls: a  
1882 - });  
1883 - },  
1884 - closePromModal: function() {  
1885 - this.setData({  
1886 - openPromModal: !1  
1887 - });  
1888 - },  
1889 - openPromModal: function() {  
1890 - this.setData({  
1891 - openPromModal: !0  
1892 - });  
1893 - },  
1894 - 691 +
1895 //--点击分享事件--- 692 //--点击分享事件---
1896 onShareAppMessage: function(t) { 693 onShareAppMessage: function(t) {
1897 - 694 +
1898 var th = this; 695 var th = this;
1899 var price = th.data.data.shop_price; 696 var price = th.data.data.shop_price;
1900 if (th.data.prom_act) { 697 if (th.data.prom_act) {
@@ -1968,308 +765,90 @@ Page({ @@ -1968,308 +765,90 @@ Page({
1968 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 765 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1969 }, 766 },
1970 767
1971 - //----------装载同一条形码的商品----------  
1972 - async get_sku(stoid, sku, g_id, is_normal, func) {  
1973 - var tt = this,arrdata=null;  
1974 - var now=ut.gettimestamp();  
1975 -  
1976 - await getApp().request.promiseGet("/api/weshop/goods/page", {  
1977 - data: {  
1978 - store_id: o.stoid,  
1979 - sku: sku,  
1980 - isonsale: 1,  
1981 - is_on_sale: 1,  
1982 - pageSize:500 768 +
  769 + //---------拿出门店分类和门店------------
  770 + get_sto(e) {
  771 + var th = this,that=this;
  772 + var timer_get = setInterval(function() {
  773 + if (th.data.is_get_local_ok == 0) return false;
  774 + var i = getApp().request;
  775 + if (!th.data.data) return false;
  776 + var dd= {
  777 + store_id: o.stoid,
  778 + isstop: 0,
  779 + pageSize: 2000
  780 + }
  781 + //如果有距离的话
  782 + if (th.data.lat != null) {
  783 + dd.lat = th.data.lat;
  784 + dd.lon = th.data.lon;
1983 } 785 }
1984 - }).then(res => {  
1985 - var e = res;  
1986 - if (e.data.code == 0) arrdata = e.data.data.pageData;  
1987 - })  
1988 - if(!arrdata) return fasle; 786 + clearInterval(timer_get);
  787 +
  788 + //如果会员是有默认的门店话
  789 + if(!th.data.def_pick_store && th.data.fir_def_store){
  790 + th.setData({def_pick_store:th.data.fir_def_store});
  791 + }
  792 +
  793 + wx.showLoading({
  794 + title:'加载中.'
  795 + });
  796 + //----------获取门店----------------
  797 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  798 + data: dd,
  799 + }).then(res => {
  800 + var e = res;
  801 + if (e.data.code == 0) {
  802 + //--普通门店排版--
  803 + setTimeout(function(){
  804 + var sto_list=th.data.data.storageId;
  805 + if(sto_list){
  806 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  807 + var it=e.data.data.pageData[k];
  808 + if (sto_list.indexOf(it.keyid)==-1) {
  809 + //删除
  810 + e.data.data.pageData.splice(k--, 1);
  811 + }
  812 + }
  813 + }
1989 814
1990 - var arrsku = new Array();  
1991 - var gitem = null;  
1992 - var gb = 1,gg = "";  
1993 - for (var i = 0; i < arrdata.length; i++) {  
1994 - var goodsinfo=arrdata[i],prom=null;  
1995 - if (goodsinfo.goods_id != g_id) {  
1996 - if(goodsinfo.prom_type==1){  
1997 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
1998 - }).then(res=>{  
1999 - if(res.data.code==0) prom=res.data.data;  
2000 - })  
2001 - }  
2002 - if(goodsinfo.prom_type==6){  
2003 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2004 - }).then(res=>{  
2005 - if(res.data.code==0) prom=res.data.data;  
2006 - })  
2007 - }  
2008 - }  
2009 - //---如果有活动,不算在一起---  
2010 - if(prom){  
2011 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){  
2012 - continue;  
2013 - }  
2014 - }  
2015 -  
2016 - var item = arrdata[i],gg = "";  
2017 - if(item.goods_spec=="null" || item.goods_spec==null) item.goods_spec="";  
2018 - if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";  
2019 -  
2020 - if (item.goods_spec != "" && item.goods_color != "") {  
2021 - gg = item.goods_spec + "/" + item.goods_color;  
2022 - } else if (item.goods_spec != "" || item.goods_color != "") {  
2023 - gg = item.goods_spec + item.goods_color;  
2024 - } else {  
2025 - gg = "规格" + gb;  
2026 - gb++;  
2027 - }  
2028 - item.gg = gg;  
2029 -  
2030 - if(item.spec_img)  
2031 - item.original_img=os.imghost+item.spec_img;  
2032 - else  
2033 - item.original_img=os.imghost+item.original_img;  
2034 -  
2035 -  
2036 - if (item.goods_id == g_id) {  
2037 - gitem = item;  
2038 - } else {  
2039 - arrsku.push(item);  
2040 - }  
2041 - }  
2042 - //-----------排列在最前面-------------  
2043 - arrsku.splice(0, 0, gitem);  
2044 - if (is_normal == 1) {  
2045 - tt.setData({  
2046 - sku_g_pt: arrsku,  
2047 - sele_g: gitem  
2048 - });  
2049 - func();  
2050 - } else {  
2051 - tt.setData({  
2052 - sku_g: arrsku,  
2053 - sele_g: gitem  
2054 - });  
2055 - }  
2056 - },  
2057 -  
2058 - //-----------选择属性的按钮事件----------  
2059 - sele_spec: function(e) {  
2060 - var that=this,ee=this,th=this;  
2061 - var gid = e.currentTarget.dataset.gid;  
2062 - var sku_g = this.data.sku_g;  
2063 - var item = null;  
2064 - for (var i in sku_g) {  
2065 - if (sku_g[i].goods_id == gid) {  
2066 - item = sku_g[i];  
2067 - break  
2068 - }  
2069 - }  
2070 - if (item) this.setData({  
2071 - sele_g: item,  
2072 - gid: gid  
2073 - });  
2074 -  
2075 - that.check_is_youhui(gid)  
2076 -  
2077 - var ty=0;  
2078 -  
2079 - this.get_sto();  
2080 -  
2081 -  
2082 - //默认门店要拿下门店库存  
2083 - if(that.data.sales_rules==2 && that.data.def_pick_store){  
2084 - var lock=0,plist=null;  
2085 - //先读取门店的lock,采用链式写法,少用await  
2086 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2087 - data:{store_id:os.stoid,wareId:ee.data.sele_g.goods_id,storageId:that.data.def_pick_store.pickup_id,pageSize:1000}  
2088 - }).then(res=>{  
2089 - if(res.data.code==0 && res.data.data.total>0){  
2090 - for(var i in res.data.data.pageData)  
2091 - lock+=res.data.data.pageData[i].outQty  
2092 - }  
2093 - //---通过接口获取门店的线下库存信息--  
2094 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2095 - data:{storageNos:that.data.def_pick_store.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid}  
2096 - })  
2097 - }).then(res=>{  
2098 - if(res.data.code==0 && res.data.data.total>0){  
2099 - plist=res.data.data.pageData[0];  
2100 - }  
2101 - if(plist && plist.CanOutQty-lock>0){  
2102 - that.data.def_pick_store.CanOutQty=plist.CanOutQty-lock;  
2103 - }else{  
2104 - that.data.def_pick_store.CanOutQty=0;  
2105 - }  
2106 - //--给门店赋值线下库存--  
2107 - th.setData({def_pick_store:that.data.def_pick_store});  
2108 - })  
2109 - }  
2110 -  
2111 -  
2112 - this.sele_spec_chech_activity();  
2113 - },  
2114 -  
2115 - //选择了不同的规格的时候要判断是不是有活动正在进行中  
2116 - async sele_spec_chech_activity(){  
2117 - //---如果是活动的时候---  
2118 - var prom=null,goodsinfo=this.data.sele_g,th=this;  
2119 - if(goodsinfo.prom_type==1){  
2120 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2121 - }).then(res=>{  
2122 - if(res.data.code==0){  
2123 - prom=res.data.data;  
2124 - }  
2125 - })  
2126 - }  
2127 - if(goodsinfo.prom_type==6){  
2128 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2129 - }).then(res=>{  
2130 - if(res.data.code==0){  
2131 - prom=res.data.data;  
2132 - }  
2133 - })  
2134 - }  
2135 - //----------如果有活动,并且在进行中,就不计算线下库存---------------  
2136 - var now=ut.gettimestamp();  
2137 - if(prom){  
2138 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){  
2139 - th.setData({  
2140 - prom_type:goodsinfo.prom_type,  
2141 - prom_price:prom.price,  
2142 - prom_buy_limit:prom.buy_limit,  
2143 - prom_end_time:prom.end_time,  
2144 - prom_start_time:prom.start_time,  
2145 - prom_st:1,  
2146 - })  
2147 - return false;  
2148 - }  
2149 - }  
2150 - //---设置普通商品---  
2151 - th.setData({  
2152 - prom_type:0,  
2153 - prom_price:null,  
2154 - prom_buy_limit:null,  
2155 - prom_end_time:null,  
2156 - prom_start_time:null,  
2157 - prom_st:null,  
2158 - })  
2159 -  
2160 - },  
2161 -  
2162 -  
2163 - //---------拿出门店分类和门店------------  
2164 - get_sto(e) {  
2165 - var th = this,that=this;  
2166 - var is_normal=e;  
2167 -  
2168 - if(e==1){  
2169 - th.setData({is_normal:1})  
2170 - }else{  
2171 - th.setData({is_normal:0})  
2172 - }  
2173 -  
2174 - var timer_get = setInterval(function() {  
2175 - if (th.data.is_get_local_ok == 0) return false;  
2176 - var dd = null,i = getApp().request;  
2177 - if (!th.data.sele_g) return false;  
2178 -  
2179 - var g_distr_type = th.data.sele_g.distr_type;  
2180 - if (g_distr_type != 0) {  
2181 - dd = {  
2182 - store_id: o.stoid,  
2183 - distr_type: g_distr_type,  
2184 - isstop: 0,  
2185 - pageSize: 2000  
2186 - }  
2187 - } else {  
2188 - dd = {  
2189 - store_id: o.stoid,  
2190 - isstop: 0,  
2191 - pageSize: 2000  
2192 - }  
2193 - }  
2194 - //如果有距离的话  
2195 - if (th.data.lat != null) {  
2196 - dd.lat = th.data.lat;  
2197 - dd.lon = th.data.lon;  
2198 - }  
2199 - clearInterval(timer_get);  
2200 -  
2201 - //如果会员是有默认的门店话  
2202 - if(!th.data.def_pick_store && th.data.fir_def_store){  
2203 - th.setData({def_pick_store:th.data.fir_def_store});  
2204 - }  
2205 -  
2206 - /*--最新的,不用这里筛选配送方式  
2207 - if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){  
2208 - th.setData({def_pick_store:null});  
2209 - }--*/  
2210 -  
2211 -  
2212 - wx.showLoading({  
2213 - title:'加载中.'  
2214 - });  
2215 - //----------获取门店----------------  
2216 - getApp().request.promiseGet("/api/weshop/pickup/list", {  
2217 - data: dd,  
2218 - }).then(res => {  
2219 - var e = res;  
2220 -  
2221 - if (e.data.code == 0) {  
2222 -  
2223 - //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店  
2224 - if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){  
2225 - th.setData({  
2226 - def_pick_store:e.data.data.pageData[0],  
2227 - sto_sele_name: e.data.data.pageData[0].pickup_name,  
2228 - sto_sele_id: e.data.data.pageData[0].pickup_id,  
2229 - sto_sele_distr: e.data.data.pageData[0].distr_type  
2230 - });  
2231 - th.data.fir_def_store=e.data.data.pageData[0];  
2232 - }  
2233 -  
2234 - //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --  
2235 - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){  
2236 - for (var k = 0; k < e.data.data.pageData.length; k++) {  
2237 - if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {  
2238 - e.data.data.pageData.splice(k, 1); //删除  
2239 - break;  
2240 - }  
2241 - }  
2242 - e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加  
2243 - }  
2244 -  
2245 -  
2246 - th.setData({all_pick_list:e.data.data.pageData}); 815 + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
  816 + if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){
  817 + th.setData({
  818 + def_pick_store:e.data.data.pageData[0],
  819 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  820 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  821 + sto_sele_distr: e.data.data.pageData[0].distr_type
  822 + });
  823 + th.data.fir_def_store=e.data.data.pageData[0];
  824 + }
2247 825
2248 - //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--  
2249 - if(th.data.sales_rules==2 && !th.data.is_newsales_rules && ((th.data.prom_type!=1 && th.data.prom_type!=6 && th.data.prom_type!=4) || is_normal==1)){  
2250 - setTimeout(function(){  
2251 - th.deal_pickup_dline(e);  
2252 - },800)  
2253 - }else{  
2254 - setTimeout(function(){  
2255 - th.deal_pickup(e); //--普通门店排版--  
2256 - },800)  
2257 - } 826 + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --
  827 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){
  828 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  829 + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
  830 + e.data.data.pageData.splice(k, 1); //删除
  831 + break;
  832 + }
  833 + }
  834 + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
  835 + }
  836 +
  837 + th.setData({all_pick_list:e.data.data.pageData});
  838 + th.deal_pickup(e);
  839 + },800)
  840 +
2258 } 841 }
2259 }) 842 })
2260 }, 200) 843 }, 200)
2261 -  
2262 }, 844 },
2263 845
2264 846
2265 //------------处理门店--------------- 847 //------------处理门店---------------
2266 deal_pickup(e){ 848 deal_pickup(e){
2267 var th=this; 849 var th=this;
2268 - if(!th.data.sele_g) return false  
2269 -  
2270 - var g_distr_type=th.data.sele_g.distr_type; 850 + if(!th.data.data) return false
2271 wx.hideLoading(); 851 wx.hideLoading();
2272 -  
2273 //单总量超出5个的时候 852 //单总量超出5个的时候
2274 if (e.data.data.total > 5) { 853 if (e.data.data.total > 5) {
2275 getApp().request.get("/api/weshop/storagecategory/page", { 854 getApp().request.get("/api/weshop/storagecategory/page", {
@@ -2288,8 +867,8 @@ Page({ @@ -2288,8 +867,8 @@ Page({
2288 var ishas = 0; 867 var ishas = 0;
2289 //-- 开始就看5个门店 -- 868 //-- 开始就看5个门店 --
2290 for (var k = 0; k < 5; k++) { 869 for (var k = 0; k < 5; k++) {
2291 - if (k == e.data.data.pageData.length) break;  
2292 - def_arr.push(e.data.data.pageData[k]); 870 + if (k == e.data.data.pageData.length) break;
  871 + def_arr.push(e.data.data.pageData[k]);
2293 } 872 }
2294 873
2295 th.setData({ 874 th.setData({
@@ -2368,7 +947,6 @@ Page({ @@ -2368,7 +947,6 @@ Page({
2368 if(newarr.length>0) 947 if(newarr.length>0)
2369 newarr.sort(compare("sort")); 948 newarr.sort(compare("sort"));
2370 949
2371 -  
2372 //----安排其他的分类----- 950 //----安排其他的分类-----
2373 if (qita.length > 0) { 951 if (qita.length > 0) {
2374 var item = { 952 var item = {
@@ -2381,1394 +959,66 @@ Page({ @@ -2381,1394 +959,66 @@ Page({
2381 959
2382 th.setData({ 960 th.setData({
2383 is_show_sto_cat: 1, 961 is_show_sto_cat: 1,
2384 - all_sto: newarr  
2385 - });  
2386 -  
2387 - } else {  
2388 - th.setData({  
2389 - is_show_sto_cat: -1,  
2390 - only_pk: e.data.data.pageData  
2391 - });  
2392 - //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------  
2393 - if (!th.data.def_pick_store) {  
2394 - th.setData({def_pick_store:e.data.data.pageData[0]})  
2395 - }  
2396 - }  
2397 - } else {  
2398 - th.setData({  
2399 - is_show_sto_cat: -1,  
2400 - only_pk: e.data.data.pageData  
2401 - });  
2402 - //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------  
2403 - if (!th.data.def_pick_store) {  
2404 - th.setData({def_pick_store:e.data.data.pageData[0]})  
2405 - }  
2406 -  
2407 - }  
2408 - }  
2409 - });  
2410 - } else {  
2411 - th.setData({  
2412 - is_show_sto_cat: 0,  
2413 - only_pk: e.data.data.pageData  
2414 - });  
2415 - //-----如果没有默认门店,要取第一个门店作为默认店------  
2416 - if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {  
2417 - th.setData({  
2418 - def_pick_store:e.data.data.pageData[0],  
2419 - sto_sele_name: e.data.data.pageData[0].pickup_name,  
2420 - sto_sele_id: e.data.data.pageData[0].pickup_id,  
2421 - sto_sele_distr: e.data.data.pageData[0].distr_type  
2422 - })  
2423 - }  
2424 - }  
2425 - },  
2426 -  
2427 - //------------处理线下门店库存--------  
2428 - deal_pickup_dline(e){  
2429 - var pkno=[],th=this;  
2430 - if(!th.data.sele_g) return false;  
2431 -  
2432 - if(this.data.def_pick_store){  
2433 - pkno.push(this.data.def_pick_store.pickup_no);  
2434 - }  
2435 - for(var i in e.data.data.pageData){  
2436 - var item=e.data.data.pageData[i];  
2437 - if(pkno.indexOf(item.pickup_no)<0)  
2438 - pkno.push(item.pickup_no);  
2439 - }  
2440 - var pkno_str=pkno.join(",");  
2441 - var o_plist=e.data.data.pageData;  
2442 - var new_list=[];  
2443 - var is_find_def_store=0;  
2444 -  
2445 -  
2446 - var g_distr_type=th.data.sele_g.distr_type;  
2447 - var lock=[];  
2448 - //先读取门店的lock,采用链式写法,少用await  
2449 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2450 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,pageSize:1000}  
2451 - }).then(res=>{  
2452 - if(res.data.code==0 && res.data.data.total>0){  
2453 - lock=res.data.data.pageData  
2454 - }  
2455 - //---通过接口获取门店的线下库存信息--  
2456 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2457 - data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000}  
2458 - })  
2459 - }).then(res=>{  
2460 -  
2461 - wx.hideLoading();  
2462 - if(res.data.code==0){  
2463 - if(res.data.data.pageData && res.data.data.pageData.length>0){  
2464 - var plist=res.data.data.pageData;  
2465 - var def_pick_store=th.data.def_pick_store;  
2466 - //以原来的数组为外循环,保证距离的顺序  
2467 - for(var kk in o_plist){  
2468 - for(var ii in plist){  
2469 - //线下的门店小心  
2470 - var n_item=plist[ii];  
2471 - if(n_item.StorageNo==o_plist[kk].pickup_no){  
2472 -  
2473 - //拿到锁库的数量  
2474 - var lock_num=th.find_lock_num(o_plist[kk].pickup_id,lock);  
2475 - //可出库数大于预出库库存的数量,可以判断为有库存  
2476 - if(n_item.CanOutQty>lock_num){  
2477 - o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num;  
2478 - new_list.push(o_plist[kk]);  
2479 - //--如果找到默认门店,同时也应该判断配送方式对不对--  
2480 - if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2481 - th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num;  
2482 - if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id)  
2483 - th.setData({def_pick_store:th.data.fir_def_store})  
2484 - is_find_def_store=1;  
2485 - }  
2486 - }  
2487 - break;  
2488 - }  
2489 - }  
2490 - }  
2491 -  
2492 - //数据组装下  
2493 - var em={};em.data={};em.data.data={};  
2494 - em.data.data.total=new_list.length;  
2495 - em.data.data.pageData=new_list;  
2496 -  
2497 - //--如果找到默认门店,同时也应该判断配送方式对不对--  
2498 - if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2499 - th.data.fir_def_store.CanOutQty=0;  
2500 - //--当选择的门店是客户默认的门店的时候--  
2501 - if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) {  
2502 - th.setData({def_pick_store:th.data.fir_def_store});  
2503 - em.data.data.pageData.unshift(th.data.def_pick_store);  
2504 - }else{  
2505 - em.data.data.pageData.splice(1,0,th.data.fir_def_store);  
2506 - }  
2507 - }  
2508 -  
2509 - //---把数组组装进去---  
2510 - th.deal_pickup(em);  
2511 - }else{  
2512 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})  
2513 - }  
2514 - }else{  
2515 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})  
2516 - }  
2517 - })  
2518 - },  
2519 -  
2520 - find_lock_num(pick_id,lock){  
2521 - var lock_num=0;  
2522 - if(!lock) return 0;  
2523 - if(lock.length<0) return 0;  
2524 - for(var i in lock){  
2525 - if(pick_id==lock[i].pickupId){  
2526 - lock_num+=lock[i].outQty;  
2527 - }  
2528 - }  
2529 - return lock_num;  
2530 - },  
2531 -  
2532 - //----------取货门店被点击的效果------  
2533 - getmendian: function(t) {  
2534 - this.setData({  
2535 - ismend: 1,  
2536 - });  
2537 - },  
2538 -  
2539 - //----------隐藏取货门店,选取门店----------  
2540 - hidemend: function(e) {  
2541 - var pid = e.target.dataset.p_id;  
2542 - var pname = e.target.dataset.p_name;  
2543 - var p_distr_t = e.target.dataset.p_dis;  
2544 - this.setData({  
2545 - ismend: 0,  
2546 - is_sec_mend: 0,  
2547 - sto_sele_id: pid,  
2548 - sto_sele_name: pname,  
2549 - sto_sele_distr: p_distr_t  
2550 - });  
2551 - },  
2552 -  
2553 - //------显示取货2级----------  
2554 - show_sec: function(t) {  
2555 - var index = t.target.dataset.index;  
2556 - var item = this.data.all_sto[index];  
2557 - this.setData({  
2558 - is_sec_mend: 1,  
2559 - sec_sto: item  
2560 - });  
2561 - },  
2562 -  
2563 - //------隐藏取货门店2级----  
2564 - hide_sec_mend: function() {  
2565 - this.setData({  
2566 - is_sec_mend: 0,  
2567 - });  
2568 - },  
2569 -  
2570 - //评论的调用  
2571 - requestComments_new: async function(){  
2572 - var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3;  
2573 - var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;  
2574 -  
2575 - wx.showLoading();  
2576 - var req_where = {  
2577 - store_id: o.stoid, pageSize: 5,is_show:1,  
2578 - parent_id: 0, goods_id: th.data.gid, commenttype: tp,  
2579 - }  
2580 - if (getApp().globalData.userInfo) {  
2581 - req_where.userId = getApp().globalData.userInfo.user_id;  
2582 - }  
2583 -  
2584 - var rs_data=null;  
2585 - await getApp().request.promiseGet(t, { data: req_where}).then(res=>{  
2586 - var tot = res.data.data.total;  
2587 - e.data.c_curr_p++;  
2588 - e.setData({  
2589 - com_num: tot, //已经有加载  
2590 - });  
2591 - if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
2592 - rs_data=res.data.data.pageData;  
2593 - }else{  
2594 - th.setData({comments_no_more:1,auto:1});  
2595 - }  
2596 - })  
2597 -  
2598 - if (rs_data){  
2599 - //var cda = th.data.comments;  
2600 - var cda = rs_data,com_data=th.data.comments;  
2601 - for (var ind in cda) {  
2602 - var ep = cda[ind];  
2603 - if (cda[ind].head_pic == '') {  
2604 - cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";  
2605 - }  
2606 - if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {  
2607 - cda[ind].weapp_img = JSON.parse(ep.weapp_img);  
2608 - }  
2609 - if (ep.img != "" && ut.isString(ep.img)) {  
2610 - cda[ind].img = ut.unserialize(ep.img);  
2611 - }  
2612 -  
2613 - //--测量多有字的宽带,计算有多少行--  
2614 - var widh=ut.measureText(ep.content,30);  
2615 - var lines=widh/712;  
2616 - cda[ind].seeMore=false;  
2617 - if(lines>3) cda[ind].seeMore=true;  
2618 -  
2619 - await getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
2620 - data: {store_id: o.stoid, parent_id: ep.comment_id }  
2621 - }).then(res => {  
2622 - if (res.data.data.pageData && res.data.data.pageData.length > 0) {  
2623 - cda[ind].replay_list = res.data.data.pageData;  
2624 - }  
2625 - })  
2626 - }  
2627 -  
2628 - if (!com_data) com_data = cda;  
2629 - else com_data = com_data.concat(cda);  
2630 -  
2631 - th.setData({ comments: com_data});  
2632 - }  
2633 - th.setData({get_c: 1});  
2634 - wx.hideLoading();  
2635 - },  
2636 -  
2637 - //加载更多是靠这个函数  
2638 - onReachBottom: function() {  
2639 - if (this.data.activeCategoryId == 2){  
2640 - if(!this.data.comments_no_more) this.requestComments_new();  
2641 - }  
2642 -  
2643 - var goods_list = this.selectComponent("#goods_list"); //组件的id  
2644 - if (goods_list) goods_list.get_list();  
2645 - },  
2646 -  
2647 - //--------检查是否活动,活动是否开始,或者是否结束-------  
2648 - async check_prom(gid, prom_type, prom_id) {  
2649 - var ee = this,  
2650 - th = ee;  
2651 - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5) {  
2652 - this.setData({  
2653 - prom_type: 0,  
2654 - isshow: 1,  
2655 - });  
2656 - return false;  
2657 - }  
2658 -  
2659 -  
2660 -  
2661 - //if (prom_type != 3 && prom_type!=0){  
2662 - //---判断秒杀----  
2663 - if (prom_type == 1) {  
2664 - //-------判断活动是否抢光---------  
2665 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
2666 - 1: 1  
2667 - }).then(res => {  
2668 - var em = res;  
2669 - if (em.data.code == 0) {  
2670 -  
2671 - if (em.data.data <= 0) ee.setData({  
2672 - prom_r_null: 1  
2673 - });  
2674 - //拿取价格并且判断时间--  
2675 - getApp().request.get("/api/ms/flash_sale/get/" +  
2676 - os.stoid + "/" + prom_id, {  
2677 - success: function(t) {  
2678 - if (t.data.code != 0) {  
2679 - ee.setData({  
2680 - prom_type: 0,  
2681 - isshow: 1,  
2682 - });  
2683 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2684 - return false;  
2685 - }  
2686 - //----已经结束-----  
2687 - if (t.data.data.is_end == 1) {  
2688 - ee.setData({  
2689 - prom_type: 0,  
2690 - isshow: 1,  
2691 - });  
2692 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2693 - ee.get_sto();  
2694 - return false;  
2695 - }  
2696 - //----已经过期-----  
2697 - var now = ut.gettimestamp();  
2698 - if (t.data.data.end_time < now) {  
2699 - ee.setData({  
2700 - prom_type: 0,  
2701 - isshow: 1,  
2702 - });  
2703 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2704 - return false;  
2705 - }  
2706 -  
2707 - /*-- 还没有开始预热的也不显示 --*/  
2708 - if (t.data.data.show_time > now) {  
2709 - ee.setData({  
2710 - prom_type: 0,  
2711 - isshow: 1,  
2712 - });  
2713 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2714 - ee.get_sto();  
2715 - return false;  
2716 - }  
2717 -  
2718 - var t_gd = ee.data.data;  
2719 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
2720 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
2721 -  
2722 - ee.setData({  
2723 - prom_price: t.data.data.price,  
2724 - prom_type: 1,  
2725 - prom_id: prom_id,  
2726 - prom_buy_limit: t.data.data.buy_limit,  
2727 - prom_act: t.data.data,  
2728 - prom_end_time: prom_end_time,  
2729 - prom_start_time: prom_start_time,  
2730 - isshow: 1,  
2731 - });  
2732 -  
2733 - ee.get_sto();  
2734 -  
2735 -  
2736 - var newTime = ut.gettimestamp();  
2737 - var endTime2 = t.data.data.end_time;  
2738 - var endTime1 = t.data.data.start_time;  
2739 -  
2740 - //---苹果机不兼容---  
2741 - /*----  
2742 - var endTime2 = new Date(prom_end_time).getTime();  
2743 - var endTime1 = new Date(prom_start_time).getTime();----*/  
2744 -  
2745 - if (endTime1 > newTime) {  
2746 - ee.setData({  
2747 - prom_time_text: '距秒杀开始还有'  
2748 - })  
2749 - ee.countDown(endTime1, 0);  
2750 - } else {  
2751 - if (endTime2 > newTime) {  
2752 - ee.setData({  
2753 - prom_time_text: '距秒杀结束还有',  
2754 - prom_st: 1  
2755 - })  
2756 - ee.countDown(endTime2);  
2757 - }  
2758 - }  
2759 - }  
2760 - });  
2761 - }  
2762 - })  
2763 - }  
2764 -  
2765 - if(prom_type==4){  
2766 - //th.setData({is_integral_normal:1});  
2767 - var rdata={  
2768 - store_id:o.stoid,stype:1,stypeup:1,goods_id:gid  
2769 - }  
2770 -  
2771 - var integrals=0;  
2772 - var get_datas= {  
2773 - user_id:getApp().globalData.user_id, store_id:o.stoid,  
2774 - };  
2775 - await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {  
2776 - data: get_datas  
2777 - }).then(res => {  
2778 - if(res.data.code==0){  
2779 - integrals=res.data.data.Integral;  
2780 - }  
2781 - })  
2782 -  
2783 - //获取一下积分活动  
2784 - await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {  
2785 - data: rdata  
2786 - }).then(res => {  
2787 - //调用接口有数据的时候  
2788 - if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {  
2789 - var inte_data=res.data.data.pageData[0];  
2790 - var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));  
2791 - ee.setData({  
2792 - prom_price:parseFloat(inte_data.addmoney),  
2793 - prom_integral:parseFloat(inte_data.integral),  
2794 - prom_type: 4,  
2795 - prom_id: inte_data.id,  
2796 - prom_buy_limit: inte_data.limitvipqty,  
2797 - prom_act: inte_data,  
2798 - isshow: 1,  
2799 - can_integral:can_integral,  
2800 - is_shopbuy: parseInt(inte_data.is_shopbuy?inte_data.is_shopbuy:0)  
2801 - });  
2802 - ee.get_sto();  
2803 -  
2804 - }else{  
2805 - ee.setData({prom_type: 0, isshow: 1,});  
2806 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2807 - ee.get_sto();  
2808 - return false;  
2809 - }  
2810 - })  
2811 -  
2812 - }  
2813 -  
2814 -  
2815 - //---判断拼单----  
2816 - if (prom_type == 6) {  
2817 - //-------判断活动是否抢光---------  
2818 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
2819 - 1: 1  
2820 - }).then(res => {  
2821 - var em = res;  
2822 - if (em.data.code == 0) {  
2823 -  
2824 -  
2825 - if (em.data.data <= 0) ee.setData({  
2826 - prom_r_null: 1  
2827 - });  
2828 - //拿取价格并且判断时间--  
2829 - getApp().request.get("/api/weshop/teamlist/get/" +  
2830 - os.stoid + "/" + prom_id, {  
2831 - success: function(t) {  
2832 - if (t.data.code != 0) {  
2833 - ee.setData({  
2834 - prom_type: 0,  
2835 - isshow: 1,  
2836 - });  
2837 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2838 - ee.get_sto();  
2839 - return false;  
2840 - }  
2841 - //----已经结束-----  
2842 - if (t.data.data.is_end == 1) {  
2843 - ee.setData({  
2844 - prom_type: 0,  
2845 - isshow: 1,  
2846 - });  
2847 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2848 - return false;  
2849 - }  
2850 - //----已经过期-----  
2851 - var now = ut.gettimestamp();  
2852 - if (t.data.data.end_time < now) {  
2853 - ee.setData({  
2854 - prom_type: 0,  
2855 - isshow: 1,  
2856 - });  
2857 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2858 - ee.get_sto();  
2859 - return false;  
2860 - }  
2861 -  
2862 - /*-- 还没有开始预热的也不显示 --*/  
2863 - if (t.data.data.show_time > now) {  
2864 - ee.setData({  
2865 - prom_type: 0,  
2866 - isshow: 1,  
2867 - });  
2868 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2869 - ee.get_sto();  
2870 - return false;  
2871 - }  
2872 -  
2873 - //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中-------  
2874 - getApp().request.get("/api/weshop/order/page", {  
2875 - data: {  
2876 - pt_prom_id: prom_id,  
2877 - user_id: oo.user_id,  
2878 - store_id: os.stoid,  
2879 - pageSize: 1,  
2880 - page: 1  
2881 - },  
2882 - success: function(e) {  
2883 - if (e.data.code == 0 && e.data.data.pageData.length > 0) {  
2884 - var odr = e.data.data.pageData[0];  
2885 - th.data.buy_order = odr;  
2886 - if (odr.pt_status == 0 && odr.order_status == 1) {  
2887 - th.setData({  
2888 - user_order_pt_state: 1  
2889 - });  
2890 - }  
2891 - if (odr.pt_status == 1 && odr.order_status == 1) {  
2892 - if (odr.is_zsorder == 4) {  
2893 - getApp().request.promiseGet("/api/weshop/teamgroup/page/", {  
2894 - data: {  
2895 - store_id: os.stoid,  
2896 - team_id: odr.pt_prom_id,  
2897 - listno: odr.pt_listno  
2898 - }  
2899 - }).then(res => {  
2900 - var now = ut.gettimestamp();  
2901 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
2902 - var tgr = res.data.data.pageData[0];  
2903 - //如果团的时间已经到了  
2904 - if (now >= tgr.kt_end_time) {  
2905 - th.update_jiti(tgr.id);  
2906 - } else {  
2907 - th.setData({  
2908 - user_order_pt_state: 2  
2909 - });  
2910 - }  
2911 - }  
2912 - })  
2913 -  
2914 - } else {  
2915 - th.setData({  
2916 - user_order_pt_state: 2  
2917 - });  
2918 - }  
2919 - }  
2920 -  
2921 - if (odr.pt_status == 2 && odr.is_zsorder == 4) {  
2922 - th.setData({  
2923 - user_order_pt_state: 3,  
2924 - });  
2925 - th.data.wk_order_id = odr.order_id;  
2926 - }  
2927 - }  
2928 - },  
2929 - });  
2930 -  
2931 - //----------查看阶梯团------------  
2932 - if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {  
2933 - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);  
2934 - var max_num = 0;  
2935 - t.data.data.ct_rylist.forEach(function(val, ind) {  
2936 - if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum);  
2937 - })  
2938 - t.data.data.max_ct_num = max_num;  
2939 - }  
2940 -  
2941 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
2942 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
2943 - ee.setData({  
2944 - prom_price: t.data.data.price,  
2945 - prom_type: 6,  
2946 - prom_id: prom_id,  
2947 - prom_buy_limit: t.data.data.buy_limit,  
2948 - prom_act: t.data.data,  
2949 - prom_end_time: prom_end_time,  
2950 - prom_start_time: prom_start_time,  
2951 - isshow: 1,  
2952 - });  
2953 -  
2954 - ee.get_sto();  
2955 -  
2956 - var newTime = now;  
2957 - var endTime2 = t.data.data.end_time;  
2958 - var endTime1 = t.data.data.start_time;  
2959 -  
2960 - if (endTime1 > newTime) {  
2961 - ee.setData({  
2962 - prom_time_text: '距拼单开始还剩:'  
2963 - })  
2964 - ee.countDown(endTime1, 0);  
2965 - } else {  
2966 - if (endTime2 > newTime) {  
2967 - ee.setData({  
2968 - prom_time_text: '距拼单结束还剩:',  
2969 - prom_st: 1  
2970 - })  
2971 - ee.countDown(endTime2);  
2972 - }  
2973 - }  
2974 - //-------查看有多少人在开这个团-------  
2975 - th.get_team_group(prom_id);  
2976 - }  
2977 - });  
2978 - }  
2979 - })  
2980 - }  
2981 -  
2982 - },  
2983 -  
2984 - //--获取有多少人在开团--  
2985 - async get_team_group(prom_id) {  
2986 - var teamgroup = [],  
2987 - th = this,  
2988 - grounp_tatal = 0;  
2989 - //如果活动是开团不是商家团  
2990 - if (this.data.prom_act.kttype > 1) {  
2991 - //获取活动从表信息team_id  
2992 - await getApp().request.promiseGet("/api/weshop/teamgroup/page", {  
2993 - data: {  
2994 - store_id: os.stoid,  
2995 - pageSize: 3,  
2996 - page: 1,  
2997 - state: 2,  
2998 - team_id: prom_id  
2999 - }  
3000 - }).then(res => {  
3001 - teamgroup = res.data.data.pageData;  
3002 - grounp_tatal = res.data.data.total;  
3003 - })  
3004 - //获取订单的总数这个接口不能用  
3005 - for (i = 0; i < teamgroup.length; i++) {  
3006 - await getApp().request.promiseGet("/api/weshop/order/page", {  
3007 - data: {  
3008 - store_id: os.stoid,  
3009 - pt_status: 1,  
3010 - pt_listno: teamgroup[i].listno  
3011 - }  
3012 - }).then(res => {  
3013 - var order = res.data.data.pageData;  
3014 - teamgroup[i].open_num = order.length;  
3015 - })  
3016 - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {  
3017 - var user = res.data.data;  
3018 - teamgroup[i].user = user;  
3019 - })  
3020 - }  
3021 -  
3022 - if (teamgroup.length > 0) {  
3023 - th.setData({  
3024 - teamgroup: teamgroup,  
3025 - grounp_tatal: grounp_tatal  
3026 - });  
3027 - th.countDown2();  
3028 - }  
3029 - }  
3030 - },  
3031 -  
3032 - //---小于10的格式化函数----  
3033 - timeFormat(param) {  
3034 - return param < 10 ? '0' + param : param;  
3035 - },  
3036 -  
3037 - //----倒计时函数-----  
3038 - countDown(time, prom_st) {  
3039 - if (!this.data.is_timer) return false;  
3040 - var th = this;  
3041 - // 获取当前时间,同时得到活动结束时间数组  
3042 - var endTime = time;  
3043 - var newTime = ut.gettimestamp();  
3044 - // 对结束时间进行处理渲染到页面  
3045 - var obj = null;  
3046 - // 如果活动未结束,对时间进行处理  
3047 - if (endTime - newTime > 0) {  
3048 - var time = (endTime - newTime);  
3049 - // 获取天、时、分、秒  
3050 - var day = parseInt(time / (60 * 60 * 24));  
3051 - var hou = parseInt(time % (60 * 60 * 24) / 3600);  
3052 - var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
3053 - var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
3054 - obj = {  
3055 - day: this.timeFormat(day),  
3056 - hou: this.timeFormat(hou),  
3057 - min: this.timeFormat(min),  
3058 - sec: this.timeFormat(sec)  
3059 - }  
3060 - } else {  
3061 - if (th.data.prom_st == 0) {  
3062 - //var endTime2 = new Date(th.data.prom_end_time).getTime();  
3063 - var endTime2 = th.data.prom_act.end_time;  
3064 - th.setData({  
3065 - prom_time_text: '距结束还剩:',  
3066 - prom_st: 1  
3067 - })  
3068 - setTimeout(function() {  
3069 - th.countDown(endTime2)  
3070 - }, 1000);  
3071 - return false;  
3072 -  
3073 - } else {  
3074 - //活动已结束,全部设置为'00'  
3075 - obj = {  
3076 - day: '00',  
3077 - hou: '00',  
3078 - min: '00',  
3079 - sec: '00'  
3080 - }  
3081 - th.setData({  
3082 - prom_time_text: '活动已经结束:',  
3083 - prom_st: 3  
3084 - })  
3085 - th.setData({  
3086 - djs: obj  
3087 - });  
3088 - return false;  
3089 - }  
3090 - }  
3091 -  
3092 - th.setData({  
3093 - djs: obj  
3094 - });  
3095 - setTimeout(function() {  
3096 - th.countDown(endTime)  
3097 - }, 1000);  
3098 - },  
3099 -  
3100 -  
3101 - //-------------获取购买数量的总函数----------------  
3102 - get_buy_num: function(gd, func) {  
3103 - var map = this.data.g_buy_num,  
3104 - th = this,  
3105 - user_id = getApp().globalData.user_id;  
3106 - if (user_id == null) {  
3107 - map.set(gd.goods_id, 0);  
3108 - th.setData({  
3109 - g_buy_num: map,  
3110 - prom_buy_num: 0,  
3111 - });  
3112 - "function" == typeof func && func();  
3113 - return false;  
3114 - }  
3115 -  
3116 - if (map.has(gd.goods_id)) {  
3117 - "function" == typeof func && func();  
3118 - } else {  
3119 - //----获取商品购买数----  
3120 - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
3121 - data: {  
3122 - store_id: os.stoid,  
3123 - user_id: user_id,  
3124 - goods_id: gd.goods_id  
3125 - },  
3126 - success: function(t) {  
3127 - if (t.data.code == 0) {  
3128 - var g_buy_num = t.data.data.goodsbuynum;  
3129 - if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {  
3130 - //----获取活动购买数----  
3131 - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
3132 - data: {  
3133 - store_id: os.stoid,  
3134 - user_id: user_id,  
3135 - goods_id: gd.goods_id,  
3136 - prom_type: gd.prom_type,  
3137 - prom_id: gd.prom_id  
3138 - },  
3139 - //-----获取-----  
3140 - success: function(tt) {  
3141 - if (tt.data.code == 0) {  
3142 - map.set(gd.goods_id, g_buy_num);  
3143 - th.setData({  
3144 - g_buy_num: map,  
3145 - prom_buy_num: tt.data.data.goodsbuynum,  
3146 - });  
3147 - "function" == typeof func && func();  
3148 - }  
3149 - }  
3150 - });  
3151 - } else {  
3152 - map.set(gd.goods_id, g_buy_num);  
3153 - th.setData({  
3154 - g_buy_num: map  
3155 - });  
3156 - "function" == typeof func && func();  
3157 - }  
3158 - }  
3159 - }  
3160 - });  
3161 - }  
3162 - },  
3163 -  
3164 - //--拼单推荐的显示---  
3165 - tj_Click: function(e) {  
3166 - var ind = parseInt(e.target.dataset.ind);  
3167 - this.setData({  
3168 - is_show_gz: ind  
3169 - });  
3170 - },  
3171 -  
3172 - //--------拼团玩法显示详情--------  
3173 - show_pt_xx: function(e) {  
3174 - this.setData({  
3175 - pd_xx: 1,  
3176 - })  
3177 - },  
3178 - close_pt_xx: function() {  
3179 - this.setData({  
3180 - pd_xx: 0,  
3181 - })  
3182 - },  
3183 -  
3184 - //--点击弹起拼单--  
3185 - openSpecModel_pt: function(e) {  
3186 -  
3187 -  
3188 - this.setData({ open_ind_store: 4});//拼团直接给4  
3189 -  
3190 -  
3191 - //--先判断会员状态--  
3192 - var user_info = getApp().globalData.userInfo;  
3193 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
3194 - wx.navigateTo({  
3195 - url: '/pages/togoin/togoin',  
3196 - })  
3197 - return false;  
3198 - }  
3199 -  
3200 - var th = this;  
3201 - var ind = parseInt(e.currentTarget.dataset.it);  
3202 - //如果是拼单活动的普通购买  
3203 - if (ind == 1) {  
3204 - //如果拼单的sku data是空的,就要先获取一下  
3205 - if (th.data.sku_g_pt) {  
3206 - th.get_sto(1);  
3207 - th.setData({  
3208 - is_normal: ind,  
3209 - openSpecModal_pt: 1  
3210 - });  
3211 - } else {  
3212 - th.get_sto(1);  
3213 - th.get_sku(o.stoid, th.data.data.sku, th.data.gid, 1, function() {  
3214 - th.setData({  
3215 - is_normal: ind,  
3216 - openSpecModal_pt: 1  
3217 - });  
3218 - });  
3219 - }  
3220 - } else {  
3221 -  
3222 - //拼单商品从这里进,先判断有没有买过商品,  
3223 - getApp().request.get("/api/weshop/order/page", {  
3224 - data: {  
3225 - pt_prom_id: th.data.prom_act.id,  
3226 - user_id: oo.user_id,  
3227 - store_id: os.stoid,  
3228 - pageSize: 1,  
3229 - page: 1  
3230 - },  
3231 - success: function(e) {  
3232 - //--跳转到已经购买的情况--  
3233 - if (e.data.data.pageData.length > 0) {  
3234 - var odr = e.data.data.pageData[0];  
3235 - //还未支付  
3236 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3237 - wx.showModal({  
3238 - title: "您已经购买了该商品待支付中",  
3239 - success: function(a) {  
3240 - if (a.confirm) {  
3241 - wx.navigateTo({  
3242 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3243 - });  
3244 - }  
3245 - }  
3246 - });  
3247 - } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3248 -  
3249 - if(this.data.is_go_to_team_show) return false;  
3250 - this.data.is_go_to_team_show=1;  
3251 - wx.showLoading();  
3252 -  
3253 - wx.redirectTo({  
3254 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3255 - });  
3256 - } else {  
3257 - th.setData({  
3258 - is_normal: ind,  
3259 - openSpecModal_pt: 1  
3260 - });  
3261 - }  
3262 -  
3263 - } else {  
3264 - th.setData({  
3265 - is_normal: ind,  
3266 - openSpecModal_pt: 1  
3267 - });  
3268 - }  
3269 - }  
3270 - });  
3271 - }  
3272 - },  
3273 -  
3274 - //-----------------拼单生成方法---------------------  
3275 - addCart_pt: function() {  
3276 - var th = this;  
3277 - if (this.data.is_normal == 0) {  
3278 - //看一下有没有起购数,如果有起购数,要计算起购数  
3279 - var qnum = parseFloat(th.data.prom_act.minbuynum);  
3280 - if (qnum > 0 && th.data.goodsInputNum < qnum) {  
3281 - getApp().confirmBox("拼团商品至少要买" + qnum + "件!");  
3282 - return false;  
3283 - }  
3284 -  
3285 - th.addcart_pt_func();  
3286 - } else {  
3287 - th.addcart_pt_func();  
3288 - }  
3289 - },  
3290 -  
3291 - addcart_pt_func: function() {  
3292 - if (oo.user_id == null) {  
3293 - s.my_warnning("还未登录!", 0, this);  
3294 - return;  
3295 - }  
3296 - var e = this,  
3297 - th = e,  
3298 - o = this.data.sele_g;  
3299 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
3300 -  
3301 - //----------添加到购物车时,要判断限购数量,--------  
3302 - e.get_buy_num(o, async function(ee) {  
3303 -  
3304 - //---判断商品是否超出限购---  
3305 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
3306 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
3307 - wx.showModal({  
3308 - title: '提示',  
3309 - content: '超出商品限购'  
3310 - });  
3311 -  
3312 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3313 - if(num<0) num=0;  
3314 - th.setData({goodsInputNum:num})  
3315 - return false;  
3316 - }  
3317 - }  
3318 - //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---  
3319 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal!=1) {  
3320 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
3321 - wx.showModal({  
3322 - title: '提示',  
3323 - content: '超出商品活动限购'  
3324 - });  
3325 -  
3326 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3327 - if(num<0) num=0;  
3328 - th.setData({goodsInputNum:num})  
3329 - return false;  
3330 - }  
3331 - }  
3332 -  
3333 - var redis_num = 0  
3334 - //不是普通购买的时候  
3335 - if(th.data.is_normal!=1){  
3336 - //-------判断活动是否抢光---------  
3337 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {  
3338 - 1: 1  
3339 - }).then(res => {  
3340 - redis_num = res.data.data;  
3341 - })  
3342 -  
3343 - if (th.data.goodsInputNum > redis_num) {  
3344 - wx.showModal({  
3345 - title: '提示',  
3346 - content: '超出商品活动库存'  
3347 - });  
3348 -  
3349 - th.setData({goodsInputNum:redis_num})  
3350 -  
3351 - return false;  
3352 - }  
3353 - }  
3354 -  
3355 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
3356 - if (th.data.goodsInputNum > o.store_count) {  
3357 - th.setData({goodsInputNum:o.store_count})  
3358 - return s.my_warnning("超出商品库存", 0, th);  
3359 - }  
3360 -  
3361 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
3362 - this.setData({  
3363 - sto_sele_name: ""  
3364 - });  
3365 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
3366 - //--------------此时操作的数据------------  
3367 - var newd = {  
3368 - goods_id: o.goods_id,  
3369 - goods_num: th.data.goodsInputNum,  
3370 - pick_id: th.data.sto_sele_id,  
3371 - user_id: oo.user_id,  
3372 - store_id: th.data.stoid,  
3373 - goods_price: o.shop_price,  
3374 - goods_name: o.goods_name,  
3375 - goods_sn: o.goods_sn,  
3376 - sku: o.sku,  
3377 - };  
3378 -  
3379 - //---是不是从收藏夹出来的---  
3380 - if(th.data.c_guide_id){  
3381 - newd['guide_id'] = th.data.c_guide_id;  
3382 - newd['guide_type']=2;  
3383 -  
3384 - }else{  
3385 - if(getApp().globalData.guide_id){  
3386 - newd['guide_id'] = getApp().globalData.guide_id;  
3387 - newd['guide_type']=0;  
3388 -  
3389 - }  
3390 - }  
3391 -  
3392 - //让商品带上房间号  
3393 - if(th.data.sys_switch.is_skuroom_id==1){  
3394 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
3395 - newd.room_id=getApp().globalData.room_id;  
3396 - }  
3397 - }else{  
3398 - if(newd.goods_id==getApp().globalData.room_goods_id){  
3399 - newd.room_id=getApp().globalData.room_id;  
3400 - }  
3401 - }  
3402 -  
3403 - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------  
3404 -  
3405 - if(th.data.is_normal == 1){  
3406 - var conf=th.data.bconfig;  
3407 - if(conf.switch_list){  
3408 - var s_list=JSON.parse(conf.switch_list);  
3409 - //如果后台有开启等级价的功能  
3410 - if(parseInt(s_list.rank_switch)==2){  
3411 - var card_price=o[getApp().globalData.userInfo['card_field']];  
3412 - //如果会员有等级价  
3413 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
3414 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
3415 - newd.goods_price=card_price;  
3416 - }  
3417 - }  
3418 - }  
3419 - }  
3420 -  
3421 -  
3422 - //-----如果是秒杀,团购,积分购,拼团,且不是普通购买-----  
3423 - if (th.data.prom_type == 6 && th.data.is_normal!= 1) {  
3424 - newd.goods_price = th.data.prom_price;  
3425 - newd.prom_type = th.data.prom_type;  
3426 - newd.prom_id = th.data.prom_id;  
3427 - newd.kt_type = th.data.prom_act.kttype; //开团类型  
3428 - newd.is_pt_tz = 0;  
3429 - //th.data.sto_sele_distr=1; //直接用自提的方式提交  
3430 - if (newd.kt_type > 1) {  
3431 - newd.is_pt_tz = 1; //开团类型  
3432 - }  
3433 - if (newd.kt_type == 3) {  
3434 - th.data.sto_sele_distr = 1;  
3435 - }  
3436 -  
3437 - } else if (th.data.prom_type == 3) {  
3438 - newd.prom_type = 0;  
3439 - newd.prom_id = 0;  
3440 - }  
3441 -  
3442 - newd['pick_name'] = th.data.sto_sele_name;  
3443 - newd['pick_dis'] = th.data.sto_sele_distr;  
3444 - newd['is_normal'] = th.data.is_normal;  
3445 -  
3446 - th.buyNow_pt(newd);  
3447 - })  
3448 - },  
3449 - //----------立即购买_pt-----------  
3450 - buyNow_pt: function(e) {  
3451 - s.set_b_now(e);  
3452 - wx.navigateTo({  
3453 - url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id,  
3454 - });  
3455 - },  
3456 -  
3457 - //-------跳转pt商品-------  
3458 - go_to_nopay: function() {  
3459 - var th = this;  
3460 - url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;  
3461 - getApp().goto(url);  
3462 -  
3463 - },  
3464 - //-------跳转pt teamshow-------  
3465 - go_to_team_show: function() {  
3466 -  
3467 - if(this.data.is_go_to_team_show) return false;  
3468 - this.data.is_go_to_team_show=1;  
3469 - wx.showLoading();  
3470 -  
3471 - var th = this;  
3472 - var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;  
3473 - wx.redirectTo({  
3474 - url:url,  
3475 - })  
3476 -  
3477 - },  
3478 -  
3479 - //---拼团倒计时---  
3480 - countDown2() {  
3481 - if (!this.data.is_timer) return false;  
3482 - var th = this;  
3483 - // 获取当前时间,同时得到活动结束时间数组  
3484 - var newTime = ut.gettimestamp();  
3485 - var List = th.data.teamgroup;  
3486 - for (var j = 0; j < List.length; j++) {  
3487 - // 对结束时间进行处理渲染到页面  
3488 - var endTime = List[j].kt_end_time;  
3489 - let obj = null;  
3490 - // 如果活动未结束,对时间进行处理  
3491 - if (endTime - newTime > 0) {  
3492 - let time = (endTime - newTime);  
3493 - // 获取天、时、分、秒  
3494 - let day = parseInt(time / (60 * 60 * 24));  
3495 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
3496 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
3497 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
3498 - obj = {  
3499 - day: this.timeFormat(day),  
3500 - hou: this.timeFormat(hou),  
3501 - min: this.timeFormat(min),  
3502 - sec: this.timeFormat(sec)  
3503 - }  
3504 - } else {  
3505 - //活动已结束,全部设置为'00'  
3506 - obj = {  
3507 - day: '00',  
3508 - hou: '00',  
3509 - min: '00',  
3510 - sec: '00'  
3511 - }  
3512 - }  
3513 - var txt = "timer[" + j + "]";  
3514 - th.setData({  
3515 - [txt]: obj  
3516 - });  
3517 - }  
3518 - setTimeout(th.countDown2, 1000);  
3519 - },  
3520 - //跳转参加团  
3521 - go_cj_team: function(e) {  
3522 - var ind = e.currentTarget.dataset.ind;  
3523 - var item = this.data.teamgroup[ind];  
3524 - var id = item.id;  
3525 - var th = this;  
3526 -  
3527 - getApp().request.get("/api/weshop/order/page", {  
3528 - data: {  
3529 - pt_prom_id: item.team_id,  
3530 - user_id: oo.user_id,  
3531 - store_id: os.stoid,  
3532 - pageSize: 1,  
3533 - page: 1  
3534 - },  
3535 - success: function(e) {  
3536 - if (e.data.code != 0) {  
3537 - getApp().my_warnning("读取订单失败", 0, th);  
3538 - return fasle;  
3539 - }  
3540 - //--跳转到已经购买的情况--  
3541 - if (e.data.data.pageData.length > 0) {  
3542 - var odr = e.data.data.pageData[0];  
3543 - //还未支付  
3544 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3545 - wx.showModal({  
3546 - title: "您已经购买了该商品待支付中",  
3547 - success: function(a) {  
3548 - if (a.confirm) {  
3549 - wx.navigateTo({  
3550 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3551 - });  
3552 - } 962 + all_sto: newarr
  963 + });
  964 +
  965 + } else {
  966 + th.setData({
  967 + is_show_sto_cat: -1,
  968 + only_pk: e.data.data.pageData
  969 + });
  970 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  971 + if (!th.data.def_pick_store) {
  972 + th.setData({def_pick_store:e.data.data.pageData[0]})
3553 } 973 }
3554 - });  
3555 - } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3556 -  
3557 - if(this.data.is_go_to_team_show) return false;  
3558 - this.data.is_go_to_team_show=1;  
3559 - wx.showLoading();  
3560 -  
3561 - wx.redirectTo({  
3562 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3563 - }); 974 + }
3564 } else { 975 } else {
3565 - wx.navigateTo({  
3566 - url: "/pages/team/team_show/team_show?tg_id=" + id, 976 + th.setData({
  977 + is_show_sto_cat: -1,
  978 + only_pk: e.data.data.pageData
3567 }); 979 });
3568 - }  
3569 - }  
3570 - //--跳转到参团--  
3571 - else {  
3572 - wx.navigateTo({  
3573 - url: "/pages/team/team_show/team_show?tg_id=" + id,  
3574 - });  
3575 - }  
3576 - }  
3577 - })  
3578 -  
3579 - },  
3580 -  
3581 - //跳到团更多  
3582 - go_t_more: function() {  
3583 - var team_id = this.data.prom_id;  
3584 - wx.navigateTo({  
3585 - url: "/pages/team/team_more/team_more?team_id=" + team_id,  
3586 - });  
3587 - },  
3588 -  
3589 - //--点赞功能--  
3590 - click_zan: function(e) {  
3591 - var com_id = e.currentTarget.dataset.com_id;  
3592 - var item_id = e.currentTarget.dataset.item_id;  
3593 - var app = getApp(),  
3594 - th = this;  
3595 -  
3596 - if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {  
3597 - app.confirmBox("您还未登录");  
3598 - return false;  
3599 - }  
3600 -  
3601 - var iszan = th.data.comments[item_id].userZanNum;  
3602 - if (this.data.iszaning) return false;  
3603 - this.data.iszaning = 1;  
3604 -  
3605 -  
3606 - app.request.post("/api/weshop/commentZan/save", {  
3607 - data: {  
3608 - store_id: o.stoid,  
3609 - user_id: app.globalData.user_id,  
3610 - goods_id: th.data.gid,  
3611 - comment_id: com_id  
3612 - },  
3613 - success: function(ee) {  
3614 -  
3615 - if (ee.data.code == "-1") {  
3616 - app.my_warnning("不能给自己点赞", 0, th);  
3617 - th.data.iszaning = 0;  
3618 - return;  
3619 - }  
3620 -  
3621 - if (ee.data.code == 0 && iszan != 1) {  
3622 - var num = th.data.comments[item_id].zan_num;  
3623 - num++;  
3624 - var text = "comments[" + item_id + "].zan_num";  
3625 - var text1 = "comments[" + item_id + "].userZanNum";  
3626 - var _errObj = {};  
3627 - _errObj[text] = num;  
3628 - _errObj[text1] = 1;  
3629 - th.setData(_errObj);  
3630 -  
3631 - } else {  
3632 - var num = th.data.comments[item_id].zan_num;  
3633 - num--;  
3634 - var text = "comments[" + item_id + "].zan_num";  
3635 - var text1 = "comments[" + item_id + "].userZanNum";  
3636 - var _errObj = {};  
3637 - _errObj[text] = num;  
3638 - _errObj[text1] = 0;  
3639 - th.setData(_errObj);  
3640 - }  
3641 -  
3642 - setTimeout(function() {  
3643 - th.data.iszaning = 0;  
3644 - }, 500)  
3645 -  
3646 - }  
3647 - })  
3648 - },  
3649 -  
3650 - /*----券的开关---*/  
3651 - switchCoupon: async function(event) {  
3652 - var coupon = event.currentTarget.dataset.coupon;  
3653 - var app = getApp();  
3654 - var url = "/api/weshop/prom/coupon/pageCouponList";  
3655 - var quan_list = this.data.quan_list;  
3656 - var th = this;  
3657 -  
3658 - //当开启,且列表为空的情况下要  
3659 - if (!quan_list && coupon == "1") {  
3660 - wx.showLoading();  
3661 - await app.request.promiseGet(url, {  
3662 - data: {  
3663 - store_id: os.stoid,  
3664 - type: 1,  
3665 - pageSize: 100,  
3666 - page: 1,  
3667 - user_id: app.globalData.user_id,  
3668 - is_share:0  
3669 - }  
3670 - }).then(res => {  
3671 - wx.hideLoading();  
3672 - quan_list = res.data.data.pageData;  
3673 - }) 980 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  981 + if (!th.data.def_pick_store) {
  982 + th.setData({def_pick_store:e.data.data.pageData[0]})
  983 + }
3674 984
3675 - if (quan_list) {  
3676 - for (var ind in quan_list) {  
3677 - var ep = quan_list[ind];  
3678 - var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");  
3679 - var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");  
3680 - start = start.replace("00:00:00", "");  
3681 - end = end.replace("00:00:00", "");  
3682 - quan_list[ind].start = start;  
3683 - quan_list[ind].end = end; 985 + }
3684 } 986 }
3685 - }  
3686 -  
3687 - th.setData({  
3688 - coupon: coupon,  
3689 - quan_list: quan_list  
3690 }); 987 });
3691 - } else { 988 + } else {
3692 th.setData({ 989 th.setData({
3693 - coupon: coupon 990 + is_show_sto_cat: 0,
  991 + only_pk: e.data.data.pageData
3694 }); 992 });
  993 + //-----如果没有默认门店,要取第一个门店作为默认店------
  994 + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {
  995 + th.setData({
  996 + def_pick_store:e.data.data.pageData[0],
  997 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  998 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  999 + sto_sele_distr: e.data.data.pageData[0].distr_type
  1000 + })
  1001 + }
3695 } 1002 }
3696 }, 1003 },
3697 -  
3698 - //--查看评价--  
3699 - look_pj: function() {  
3700 - this.tabComment();  
3701 - this.doScrollTop();  
3702 - },  
3703 -  
3704 - //-----领取券-----  
3705 - get_quan: function(e) {  
3706 - var cid = e.currentTarget.dataset.cid;  
3707 - var index = e.currentTarget.dataset.ind;  
3708 - var item = this.data.quan_list[index];  
3709 -  
3710 -  
3711 - //--先判断会员状态--  
3712 - var user_info = getApp().globalData.userInfo;  
3713 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
3714 - wx.navigateTo({  
3715 - url: '/pages/togoin/togoin',  
3716 - })  
3717 - return false;  
3718 - }  
3719 -  
3720 -  
3721 - //如果券还在领取中,不能再点  
3722 - if (item.linging == 1) {  
3723 - getApp().my_warnning('领取中..', 0, this);  
3724 - return false; 1004 +
  1005 + //加载更多是靠这个函数
  1006 + onReachBottom: function() {
  1007 + if (this.data.activeCategoryId == 2){
  1008 + if(!this.data.comments_no_more) this.requestComments_new();
3725 } 1009 }
3726 1010
3727 - //如果领取的次数到了  
3728 - if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {  
3729 - getApp().my_warnning('领取失败,您已领完该券', 0, this);  
3730 - return false;  
3731 - } 1011 + var goods_list = this.selectComponent("#goods_list"); //组件的id
  1012 + if (goods_list) goods_list.get_list();
  1013 + },
3732 1014
3733 - var lq_num = item.lqnum;  
3734 1015
3735 - var pdata = {  
3736 - 'uid': oo.user_id,  
3737 - 'cid': cid,  
3738 - 'store_id': os.stoid,  
3739 - 'type': 5  
3740 - };  
3741 -  
3742 - //-- 导购ID --  
3743 - if(getApp().globalData.guide_id){  
3744 - pdata.guide_id=getApp().globalData.guide_id;  
3745 - }  
3746 -  
3747 - var app = getApp(),  
3748 - th = this;  
3749 - app.request.post("/api/weshop/couponList/saveCouponList", {  
3750 - data: pdata,  
3751 - success: function(res) {  
3752 - if (res.data.code == 0) {  
3753 - app.my_warnning("领取成功", 1, th);  
3754 - lq_num++;  
3755 - var text = "quan_list[" + index + "].lqnum";  
3756 - var text2 = "quan_list[" + index + "].linging";  
3757 - var obj = {};  
3758 - obj[text] = lq_num;  
3759 - obj[text2] = 0;  
3760 - th.setData(obj);  
3761 - } else {  
3762 - app.confirmBox(res.data.msg);  
3763 - var text2 = "quan_list[" + index + "].linging";  
3764 - var obj = {};  
3765 - obj[text2] = 0;  
3766 - th.setData(obj);  
3767 - }  
3768 - }  
3769 - }) 1016 + //---小于10的格式化函数----
  1017 + timeFormat(param) {
  1018 + return param < 10 ? '0' + param : param;
3770 }, 1019 },
3771 - 1020 +
  1021 +
3772 //--定义的保存图片方法,分享团--- 1022 //--定义的保存图片方法,分享团---
3773 saveImageToPhotosAlbum: function() { 1023 saveImageToPhotosAlbum: function() {
3774 //--先判断会员状态-- 1024 //--先判断会员状态--
@@ -4279,33 +1529,6 @@ Page({ @@ -4279,33 +1529,6 @@ Page({
4279 } 1529 }
4280 }, 1530 },
4281 1531
4282 - /*---视频相关--*/  
4283 - videopicture: function(e) {  
4284 - var vipi = e.currentTarget.dataset.vipi;  
4285 - this.setData({  
4286 - videopicture: vipi,  
4287 - swiperCurrent: vipi,  
4288 - noon: 0,  
4289 - current: 1  
4290 - });  
4291 - },  
4292 -  
4293 - videoPlay: function(e) {  
4294 - var _index = e.currentTarget.id  
4295 - this.setData({  
4296 - _index: _index,  
4297 - noon: 1  
4298 - })  
4299 -  
4300 - setTimeout(function() {  
4301 - //将点击视频进行播放  
4302 - var videoContext = wx.createVideoContext(_index)  
4303 - videoContext.play();  
4304 - }, 500)  
4305 - },  
4306 -  
4307 -  
4308 -  
4309 //--获取头像的本地缓存,回调写法-- 1532 //--获取头像的本地缓存,回调写法--
4310 get_head_temp: function(tt, func) { 1533 get_head_temp: function(tt, func) {
4311 var ee = this; 1534 var ee = this;
@@ -4358,16 +1581,6 @@ Page({ @@ -4358,16 +1581,6 @@ Page({
4358 }); 1581 });
4359 }, 1582 },
4360 1583
4361 - //--外侧评价的点击效果---  
4362 - clik_evaluate: function(e) {  
4363 - var val = e.currentTarget.dataset.val;  
4364 - this.setData({  
4365 - activeCategoryId: 2,  
4366 - activeCategoryId3: val,  
4367 - comments: null  
4368 - });  
4369 - this.requestComments_new();  
4370 - },  
4371 1584
4372 //--跳转到商品详情页面-- 1585 //--跳转到商品详情页面--
4373 go_goods: function(e) { 1586 go_goods: function(e) {
@@ -4376,11 +1589,6 @@ Page({ @@ -4376,11 +1589,6 @@ Page({
4376 getApp().goto(url); 1589 getApp().goto(url);
4377 }, 1590 },
4378 1591
4379 - //--跳转到支付尾款界面--  
4380 - go_pay_wk: function() {  
4381 - var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;  
4382 - getApp().goto(url);  
4383 - },  
4384 1592
4385 pop_err_img: function(e) { 1593 pop_err_img: function(e) {
4386 var txt = e.currentTarget.dataset.errorimg; 1594 var txt = e.currentTarget.dataset.errorimg;
@@ -4389,25 +1597,6 @@ Page({ @@ -4389,25 +1597,6 @@ Page({
4389 this.setData(ob); 1597 this.setData(ob);
4390 }, 1598 },
4391 1599
4392 - //--调用更新阶梯团的接口--  
4393 - update_jiti: function(id) {  
4394 - var th = this;  
4395 - //--更新阶梯团--  
4396 - getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {  
4397 - success: function(ee) {  
4398 - //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--  
4399 - if (ee.data.code == 0) {  
4400 - th.setData({  
4401 - user_order_pt_state: 3,  
4402 - });  
4403 - } else if (ee.data.code == -1) {  
4404 - th.setData({  
4405 - user_order_pt_state: 2,  
4406 - });  
4407 - }  
4408 - }  
4409 - })  
4410 - },  
4411 // 选择门店 1600 // 选择门店
4412 choice_store: function(ee) { 1601 choice_store: function(ee) {
4413 var th = this; 1602 var th = this;
@@ -4437,27 +1626,20 @@ Page({ @@ -4437,27 +1626,20 @@ Page({
4437 th.data.lat = res.latitude; 1626 th.data.lat = res.latitude;
4438 th.data.lon = res.longitude; 1627 th.data.lon = res.longitude;
4439 th.data.is_get_local_ok = 1; 1628 th.data.is_get_local_ok = 1;
4440 - th.setData({  
4441 - is_gps: 1  
4442 - });  
4443 - //th.onShow(); 1629 + th.setData({ is_gps: 1 });
4444 th.get_sto(th.data.is_normal); 1630 th.get_sto(th.data.is_normal);
4445 }, 1631 },
4446 fail: function(res) { 1632 fail: function(res) {
4447 - //th.onShow(); 1633 +
4448 th.data.is_get_local_ok = 1; 1634 th.data.is_get_local_ok = 1;
4449 th.get_sto(th.data.is_normal); 1635 th.get_sto(th.data.is_normal);
4450 if (res.errCode == 2) { 1636 if (res.errCode == 2) {
4451 - th.setData({  
4452 - is_gps: 0  
4453 - }); 1637 + th.setData({is_gps: 0});
4454 if (th.data.is_gps == 0) { 1638 if (th.data.is_gps == 0) {
4455 getApp().confirmBox("请开启GPS定位", null, 25000, !1); 1639 getApp().confirmBox("请开启GPS定位", null, 25000, !1);
4456 } 1640 }
4457 } else { 1641 } else {
4458 - th.setData({  
4459 - is_gps: "3"  
4460 - }); 1642 + th.setData({ is_gps: "3" });
4461 } 1643 }
4462 1644
4463 } 1645 }
@@ -4520,8 +1702,6 @@ Page({ @@ -4520,8 +1702,6 @@ Page({
4520 sort_store: 0 1702 sort_store: 0
4521 }) 1703 })
4522 } 1704 }
4523 -  
4524 -  
4525 }, 1705 },
4526 1706
4527 //选择更多门店 1707 //选择更多门店
@@ -4530,9 +1710,8 @@ Page({ @@ -4530,9 +1710,8 @@ Page({
4530 sort_store: 1 1710 sort_store: 1
4531 }); 1711 });
4532 }, 1712 },
4533 - sort_store: function() {  
4534 -  
4535 - }, 1713 +
  1714 + sort_store: function() { },
4536 // 返回按钮 1715 // 返回按钮
4537 returns: function() { 1716 returns: function() {
4538 this.setData({ 1717 this.setData({
@@ -4563,52 +1742,6 @@ Page({ @@ -4563,52 +1742,6 @@ Page({
4563 1742
4564 }, 1743 },
4565 1744
4566 - //如果开启线下库存,已经急速库存才会使用  
4567 - async check_the_pick(item,func){  
4568 - var th=this;  
4569 - var goodsinfo=th.data.sele_g;  
4570 - var erpwareid=goodsinfo.erpwareid;  
4571 - var plist=null;  
4572 - var lock=0;  
4573 -  
4574 - //---如果是活动的时候,同时不是普通购买---  
4575 - if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) {  
4576 - func(); return false;  
4577 - }  
4578 -  
4579 - if(this.data.sales_rules!=2){  
4580 - func();  
4581 - }else{  
4582 -  
4583 - //先读取门店的lock  
4584 - await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
4585 - data:{store_id:os.stoid,wareId:goodsinfo.goods_id,storageId:item.pickup_id,pageSize:1000}  
4586 - }).then(res=>{  
4587 - if(res.data.code==0 && res.data.data.total>0){  
4588 - for(var i in res.data.data.pageData )  
4589 - lock+=res.data.data.pageData[i].outQty;  
4590 - }  
4591 - })  
4592 - //读取线下的门店库存  
4593 - await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
4594 - data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}  
4595 - }).then(res=>{  
4596 - if(res.data.code==0 && res.data.data.total>0){  
4597 - plist=res.data.data.pageData[0];  
4598 - }  
4599 - })  
4600 -  
4601 - if(plist && plist.CanOutQty-lock>0){  
4602 - item.CanOutQty=plist.CanOutQty-lock;  
4603 - func();  
4604 - return false;  
4605 - }  
4606 - getApp().my_warnning(item.pickup_name+"库存不足!", 0, th);  
4607 -  
4608 - }  
4609 - },  
4610 -  
4611 -  
4612 //确定def_pick为选择的门店 1745 //确定def_pick为选择的门店
4613 sure_pick: function(e) { 1746 sure_pick: function(e) {
4614 var th = this; 1747 var th = this;
@@ -4627,30 +1760,30 @@ Page({ @@ -4627,30 +1760,30 @@ Page({
4627 var index = th.data.sec_pick_index; 1760 var index = th.data.sec_pick_index;
4628 item = th.data.sec_sto.s_arr[index]; 1761 item = th.data.sec_sto.s_arr[index];
4629 } 1762 }
4630 - 1763 +
  1764 + var ser_card=this.data.data;
4631 //判断门店的配送方式是不是匹配 1765 //判断门店的配送方式是不是匹配
4632 - var g_distr_type = th.data.sele_g.distr_type;  
4633 - if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){ 1766 + if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(item.keyid)==-1){
4634 wx.showToast({ 1767 wx.showToast({
4635 - title: "门店配送方式不匹配", 1768 + title: "该门店无此服务项目,请重新选择!",
4636 icon: 'none', 1769 icon: 'none',
4637 duration: 2000 1770 duration: 2000
4638 }); 1771 });
4639 return false; 1772 return false;
4640 } 1773 }
4641 1774
4642 - //--回调函数的用法--  
4643 - th.check_the_pick(item,function(){ 1775 +
4644 th.setData({ 1776 th.setData({
4645 def_pick_store: item, 1777 def_pick_store: item,
4646 sto_sele_name: item.pickup_name, 1778 sto_sele_name: item.pickup_name,
4647 sto_sele_id: item.pickup_id, 1779 sto_sele_id: item.pickup_id,
  1780 + sto_sele_keyid: item.keyid,
4648 sto_sele_distr: item.distr_type, 1781 sto_sele_distr: item.distr_type,
4649 store: 0, 1782 store: 0,
4650 choice_sort_store: 0, 1783 choice_sort_store: 0,
4651 fir_pick_index: 0 1784 fir_pick_index: 0
4652 }); 1785 });
4653 - 1786 +
4654 if (openindstore == 1) { 1787 if (openindstore == 1) {
4655 th.setData({ 1788 th.setData({
4656 openSpecModal: !0, 1789 openSpecModal: !0,
@@ -4662,7 +1795,7 @@ Page({ @@ -4662,7 +1795,7 @@ Page({
4662 openSpecModal_ind: openindstore, 1795 openSpecModal_ind: openindstore,
4663 }); 1796 });
4664 } 1797 }
4665 - else if (openindstore == 4) { //4就是拼团 1798 + else if(openindstore == 4) { //4就是拼团
4666 th.setData({ 1799 th.setData({
4667 openSpecModal_pt: 1, //打开拼团购买界面 1800 openSpecModal_pt: 1, //打开拼团购买界面
4668 store: 0, //关闭门店 1801 store: 0, //关闭门店
@@ -4676,11 +1809,9 @@ Page({ @@ -4676,11 +1809,9 @@ Page({
4676 choice_sort_store: 0, 1809 choice_sort_store: 0,
4677 sort_store: 0 1810 sort_store: 0
4678 }) 1811 })
4679 - }  
4680 - //如果商品没有其他活动,要取一下线下价格  
4681 - th.get_off_price();  
4682 - }) 1812 + }
4683 }, 1813 },
  1814 +
4684 //---点击二级之后的选择--- 1815 //---点击二级之后的选择---
4685 choose_for_store: function(e) { 1816 choose_for_store: function(e) {
4686 var index_c = e.currentTarget.dataset.ind; 1817 var index_c = e.currentTarget.dataset.ind;
@@ -4708,23 +1839,24 @@ Page({ @@ -4708,23 +1839,24 @@ Page({
4708 } 1839 }
4709 1840
4710 //判断门店的配送方式是不是匹配 1841 //判断门店的配送方式是不是匹配
4711 - var g_distr_type = th.data.sele_g.distr_type;  
4712 - if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){ 1842 + var ser_card=this.data.data;
  1843 + //判断门店的配送方式是不是匹配
  1844 + if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(item.keyid)==-1){
4713 wx.showToast({ 1845 wx.showToast({
4714 - title: "门店配送方式不匹配", 1846 + title: "该门店无此服务项目,请重新选择!",
4715 icon: 'none', 1847 icon: 'none',
4716 duration: 2000 1848 duration: 2000
4717 }); 1849 });
4718 return false; 1850 return false;
4719 } 1851 }
4720 1852
4721 - //先设置之前,要判断是不是有库存  
4722 - th.check_the_pick(item,function(){  
4723 - var store_id = o.stoid;  
4724 - var user_id = getApp().globalData.user_id;  
4725 - var def_pickup_id = item.pickup_id; 1853 +
  1854 +
  1855 + var store_id = o.stoid;
  1856 + var user_id = getApp().globalData.user_id;
  1857 + var def_pickup_id = item.pickup_id;
4726 1858
4727 - getApp().request.put('/api/weshop/users/update', { 1859 + getApp().request.put('/api/weshop/users/update', {
4728 data: { 1860 data: {
4729 user_id:user_id, 1861 user_id:user_id,
4730 def_pickup_id:def_pickup_id 1862 def_pickup_id:def_pickup_id
@@ -4747,6 +1879,7 @@ Page({ @@ -4747,6 +1879,7 @@ Page({
4747 def_pick_store: item, 1879 def_pick_store: item,
4748 sto_sele_name: item.pickup_name, 1880 sto_sele_name: item.pickup_name,
4749 sto_sele_id: item.pickup_id, 1881 sto_sele_id: item.pickup_id,
  1882 + sto_sele_keyid: item.keyid,
4750 sto_sele_distr: item.distr_type, 1883 sto_sele_distr: item.distr_type,
4751 store: 0, 1884 store: 0,
4752 choice_sort_store: 0 1885 choice_sort_store: 0
@@ -4787,10 +1920,6 @@ Page({ @@ -4787,10 +1920,6 @@ Page({
4787 }) 1920 })
4788 } 1921 }
4789 1922
4790 - //如果商品没有其他活动,要取一下线下价格  
4791 - th.get_off_price();  
4792 -  
4793 - })  
4794 }, 1923 },
4795 1924
4796 wait_for_store_config: function() { 1925 wait_for_store_config: function() {
@@ -4830,135 +1959,26 @@ Page({ @@ -4830,135 +1959,26 @@ Page({
4830 clearInterval(t_time); 1959 clearInterval(t_time);
4831 }, 500) 1960 }, 500)
4832 }, 1961 },
4833 - //显示全部  
4834 - toggleHandler: function(e) {  
4835 - var that = this,  
4836 - index = e.currentTarget.dataset.index;  
4837 - for (var i = 0; i < that.data.comments.length; i++) {  
4838 - if (index == i) {  
4839 - for (var i = 0; i < that.data.comments.length; i++) {  
4840 - that.data.comments[index].auto = true;  
4841 - that.data.comments[index].seeMore = false;  
4842 - }  
4843 - }  
4844 - }  
4845 - that.setData({  
4846 - comments: that.data.comments  
4847 - })  
4848 - },  
4849 -  
4850 - //收起更多  
4851 - toggleContent: function(e) {  
4852 - var that = this,  
4853 - index = e.currentTarget.dataset.index;  
4854 - for (var i = 0; i < that.data.comments.length; i++) {  
4855 - if (index == i) {  
4856 - that.data.comments[index].auto = true;  
4857 - that.data.comments[index].seeMore = true;  
4858 - }  
4859 - }  
4860 - that.setData({  
4861 - comments: that.data.comments  
4862 - })  
4863 - },  
4864 -  
4865 - //--- 获取卡类列表 ---  
4866 - getPlusCardType: function (func) {  
4867 - var storid = os.stoid;  
4868 - var th = this;  
4869 - var user=getApp().globalData.userInfo;  
4870 - if(!user) return false;  
4871 - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {  
4872 - var plusCard = res.data.data;  
4873 - var arr = [1219, 2089, 3031];  
4874 - var new_arr = new Array();  
4875 - var card_name_map=new Map();  
4876 - for (var i = 0; i < plusCard.length; i++) {  
4877 - if((user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;  
4878 - var name="card"+plusCard[i].CorrPrice.toLowerCase();  
4879 - card_name_map.set(name,plusCard[i].CardName);  
4880 - }  
4881 -  
4882 - var ob={"card_list":plusCard,"name_map":card_name_map};  
4883 - func(ob);  
4884 - })  
4885 - },  
4886 -  
4887 - go_plus:function(){  
4888 - getApp().goto("/pages/user/plus/plus");  
4889 - },  
4890 - go_card_info:function(){  
4891 - getApp().goto("/pages/user/cardinfo/cardinfo");  
4892 - }, 1962 +
  1963 +
4893 //-- 根据ID拿出门店 -- 1964 //-- 根据ID拿出门店 --
4894 get_pick_from_list(pid){ 1965 get_pick_from_list(pid){
4895 var all_pick_list=this.data.all_pick_list; 1966 var all_pick_list=this.data.all_pick_list;
4896 for(var i in all_pick_list){ 1967 for(var i in all_pick_list){
4897 var item=all_pick_list[i]; 1968 var item=all_pick_list[i];
4898 - if(item.pickup_id==pid){  
4899 - return item;  
4900 - }  
4901 - }  
4902 - },  
4903 - //-----显示优惠券的时候情况-----  
4904 - show_more_cx:function () {  
4905 - if(this.data.is_more_cx){  
4906 - this.setData({is_more_cx:0});  
4907 - }else{  
4908 - this.setData({is_more_cx:1}); 1969 + if(item.pickup_id==pid){ return item;}
4909 } 1970 }
4910 }, 1971 },
4911 -  
4912 - //----跳转到搭配购买----  
4913 - go_prom_list:function () {  
4914 -  
4915 - var url= "../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid;  
4916 - var room_id= getApp().globalData.room_id;  
4917 - if(room_id && this.data.gid==getApp().globalData.room_goods_id){  
4918 - url+="&room_id="+room_id;  
4919 - }  
4920 - wx.navigateTo({ url: url,})  
4921 - },  
4922 -  
4923 - //---检查有没有优惠活动---  
4924 - check_is_youhui:function(gid){  
4925 - var th=this;  
4926 - //调用接口判断订单优惠,  
4927 - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {}).then(res => {  
4928 - if(res.data.code==0){  
4929 - var r_data=res.data.data;  
4930 - var max=0,min=0;  
4931 - if(r_data.collocationList){  
4932 - for(var i in r_data.collocationList){  
4933 - if(max==0) max=r_data.collocationList[i].price;  
4934 - if(min==0) min=r_data.collocationList[i].price;  
4935 -  
4936 - if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;  
4937 - if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;  
4938 - }  
4939 - r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);  
4940 - r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);  
4941 - }  
4942 - th.setData({  
4943 - order_prom:r_data.promOrder,  
4944 - collocationGoods:r_data.collocationPromList,  
4945 - prom_goods:r_data.promGoodsLists,  
4946 - })  
4947 -  
4948 - th.is_show_more_buy();  
4949 - }  
4950 - })  
4951 - },  
4952 -  
4953 - closePoster() { 1972 +
  1973 + closePoster() {
4954 this.setData({ 1974 this.setData({
4955 showPoster: false, 1975 showPoster: false,
4956 }); 1976 });
4957 - }, 1977 + },
4958 1978
4959 // 保存图片到手机 1979 // 保存图片到手机
4960 - savePic() {  
4961 - console.log('保存图片'); 1980 + savePic() {
  1981 + console.log('保存图片');
4962 var self = this; 1982 var self = this;
4963 // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 1983 // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
4964 this.getSetting().then((res) => { 1984 this.getSetting().then((res) => {
@@ -4977,9 +1997,7 @@ Page({ @@ -4977,9 +1997,7 @@ Page({
4977 // 如果已经授权,保存下载文件 1997 // 如果已经授权,保存下载文件
4978 this.saveImage(self.data.shareImgPath) 1998 this.saveImage(self.data.shareImgPath)
4979 .then(() => { 1999 .then(() => {
4980 - self.setData({  
4981 - showPoster: false  
4982 - }); 2000 + self.setData({ showPoster: false });
4983 }); 2001 });
4984 } 2002 }
4985 2003
@@ -5027,8 +2045,7 @@ Page({ @@ -5027,8 +2045,7 @@ Page({
5027 }) 2045 })
5028 }) 2046 })
5029 }, 2047 },
5030 -  
5031 - 2048 +
5032 // 保存图片到系统相册 2049 // 保存图片到系统相册
5033 saveImage(saveUrl) { 2050 saveImage(saveUrl) {
5034 var self = this; 2051 var self = this;
@@ -5061,61 +2078,7 @@ Page({ @@ -5061,61 +2078,7 @@ Page({
5061 urls: [this.data.shareImgPath] 2078 urls: [this.data.shareImgPath]
5062 }); 2079 });
5063 }, 2080 },
5064 -  
5065 - is_show_more_buy:function(){  
5066 - var prom_goods=this.data.prom_goods;  
5067 - var per_price=this.data.sele_g.shop_price  
5068 - if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){  
5069 - per_price=this.data.sele_g[this.data.card_field];  
5070 - }  
5071 - var all_price=per_price*this.data.goodsInputNum;  
5072 - var con=null;  
5073 - for(var i in prom_goods){  
5074 - var item=prom_goods[i];  
5075 - if(item.prom_type==1){  
5076 - if(item.condition>this.data.goodsInputNum) {  
5077 - con=item;  
5078 - con.need=(item.condition-this.data.goodsInputNum)+"件";  
5079 - break;  
5080 - }  
5081 - }else{  
5082 - if(item.condition>all_price){  
5083 - con=item;  
5084 - con.need=(item.condition-all_price)+"元";  
5085 - break;  
5086 - }  
5087 - }  
5088 - }  
5089 -  
5090 - this.setData({hui_condition:con});  
5091 -  
5092 - },  
5093 -  
5094 - //-- 积分购 --  
5095 - go_pay_integral:function(){  
5096 - this.get_sto(0)  
5097 - this.setData({openSpecModal_inte:1});  
5098 - },  
5099 - //-- 积分购普通购买 --  
5100 - go_pay_integral_normal:function(){  
5101 - this.get_sto(1)  
5102 - this.setData({openSpecModal_inte_normal:1});  
5103 - },  
5104 -  
5105 - closeSpecModal_inte:function(){  
5106 - this.setData({openSpecModal_inte:0});  
5107 - } ,  
5108 - closeSpecModal_inte_normal:function(){  
5109 - this.setData({openSpecModal_inte_normal:0});  
5110 - },  
5111 -  
5112 - addCart_inte:function(t){  
5113 - this.add_cart_func_inte(t);  
5114 - },  
5115 -  
5116 -  
5117 -  
5118 - 2081 +
5119 onShareTimeline() { 2082 onShareTimeline() {
5120 return { 2083 return {
5121 title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name, 2084 title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name,
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -14,419 +14,41 @@ @@ -14,419 +14,41 @@
14 </view> 14 </view>
15 </view> 15 </view>
16 </view> --> 16 </view> -->
17 -  
18 <view class="goods-detail"> 17 <view class="goods-detail">
19 - <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">  
20 - <!-- 视频 -->  
21 - <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}"  
22 - indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> --> 18 + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
23 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> 19 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
24 -  
25 <view class="xc-videos-picture rel"> 20 <view class="xc-videos-picture rel">
26 - <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">  
27 - <!-- <swiper-item> -->  
28 - <!-- <swiper-item wx:if="{{mapurl}}"> -->  
29 - <!-- <view wx:if="{{noon == 0}}">  
30 - <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">  
31 - <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>  
32 - </image>  
33 - </view>  
34 - <view wx:else>  
35 - <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"> </video>  
36 - </view>  
37 - </swiper-item> -->  
38 -  
39 - <!-- <swiper-item wx:for="{{gallery}}" wx:key="gallery"> -->  
40 - <swiper-item>  
41 - <image class="wh100" src="{{iurl + data.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>  
42 - </swiper-item>  
43 - </swiper>  
44 - <!-- <block wx:if="{{mapurl}}">  
45 - <view wx:if="{{hiddenn==1}}">  
46 - <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>  
47 - </view>  
48 - <view class="xc-video-picture abs">  
49 - <view class="xc-video" data-vipi="0" bindtap="videopicture">  
50 - <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">  
51 - 视频  
52 - </view>  
53 - </view>  
54 - <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">  
55 - <view>  
56 - 图片  
57 - </view>  
58 - </view>  
59 - </view>  
60 - </block> --> 21 + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
  22 + <swiper-item>
  23 + <image class="wh100" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" binderror="bind_bnerr"
  24 + mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>
  25 + </swiper-item>
  26 + </swiper>
61 </view> 27 </view>
62 </view> 28 </view>
63 29
64 -  
65 - <!----显示秒杀价,团购,积分购---->  
66 - <!-- <view class="prom_show rel" wx:if="{{prom_type==1}}">  
67 -  
68 - <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image>  
69 - <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>  
70 -  
71 - <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
72 - <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view>  
73 - <view class="secview flex abs fs24 xc-miaosha-time">  
74 - <block wx:if="djs.day">  
75 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.day}}</view>  
76 - <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
77 - </block>  
78 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
79 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
80 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
81 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
82 - <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
83 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>  
84 - </view>  
85 - </view> -->  
86 -  
87 - <!----拼单---->  
88 - <!-- <view class="pt_show " wx:if="{{prom_type==6}}">  
89 - <view class="pt_view rel"> -->  
90 - <!--许程 7. 24 -->  
91 - <!-- <image class="secondkill-img" src="{{prom_st==1? iurl+'/miniapp/images/red_jx.png':iurl+'/miniapp/images/blue_ks.png'}}"></image>  
92 - <view class="abs xc-qt-price">  
93 - <view class="flex" style='height:40rpx; margin-top:5rpx'>  
94 - <view class="flex fs35 xc-qtsign">¥</view>  
95 - <view class="fs50 val">{{prom_price}}</view>  
96 - </view>  
97 - <view class="word-line fs20 xc-qtunit-price">零售价¥{{data.market_price}}</view>  
98 - </view>  
99 - <view class="abs white xc-nanber">  
100 - <text class="fs22">已拼{{prom_act.buy_num}}件</text>  
101 - <view class="flex" style='margin-top:-34rpx'>  
102 - <view class="xc-people-img">  
103 - <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image>  
104 - </view>  
105 - <view class="t-s fs20 xc-people-val">  
106 - {{prom_act.ct_num}}人拼  
107 - </view>  
108 - </view>  
109 - </view>  
110 - <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
111 - <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>  
112 - <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">  
113 - <block wx:if="djs.day">  
114 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}};margin-top:-34rpx;">{{djs.day}}</view>  
115 - <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
116 - </block>  
117 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
118 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
119 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
120 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
121 - <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
122 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>  
123 - </view>  
124 - </view>  
125 -  
126 - <view class="pt_fir"> -->  
127 - <!----显示团类型和团价格---->  
128 - <!-- <view class="pt_fir_title "> -->  
129 - <!-- 许程 商家团主页 -->  
130 - <!-- <view class="xc-goods-explain flex-vertical-between">  
131 - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}">  
132 - {{data.goods_name}}  
133 - </view>  
134 -  
135 - <view class="xc-share-frame-jieti flex" bindtap="saveImageToPhotosAlbum" style="top:0">  
136 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
137 - <view class="share-font">分享</view>  
138 - </view>  
139 - </view>  
140 - </view> -->  
141 -  
142 - <!----显示价格,阶梯团---->  
143 - <!-- <block wx:if="{{prom_act.kttype==3}}">  
144 - <view class="jie_price flex">  
145 - <view style='margin-right:26rpx' wx:for="{{prom_act.ct_rylist}}">  
146 - <view class="fs35 word-color">  
147 - <text class="fs24">¥</text>{{item.price}}</view>  
148 - <view class="fs24 t-c xc-person-number ">满{{item.rynum}}人</view>  
149 - </view>  
150 - </view>  
151 - </block>  
152 - </view>  
153 -  
154 - <view class="t_gz" wx:if="{{is_show_gz==1}}">  
155 - {{prom_act.remark}}  
156 - </view> -->  
157 -  
158 - <!----------正有多少人在开团---------->  
159 - <!-- <view class="pt_fir se2" wx:if="{{teamgroup}}">  
160 - <view class="xc-partner-frame">  
161 - <view class="zzk-1" bindtap="go_t_more">以下小伙伴正在拼单,可直接参与  
162 - <view class="ckgd flex">查看详细  
163 - <view class="bg_right arrow-one"></view>  
164 - </view>  
165 - </view>  
166 - </view>  
167 - <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup" style='padding-left:28rpx;'>  
168 - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}"> -->  
169 - <!--//选项框头像-->  
170 - <!-- <view class='gtou'>  
171 - <image src='{{item.user.head_pic}}'></image>  
172 - </view> -->  
173 - <!--//等你来拼-->  
174 - <!-- <view class='gdn ellipsis-1'>{{item.user.nickname}}</view> -->  
175 - <!--//还差几人,剩余时间-->  
176 - <!-- <view class="rel">  
177 - <view class='ghaicha ellipsis-2 abs'>  
178 - <text class='gred' wx:if="{{prom_act.max_ct_num >0}}"><text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}">还差<text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text>人享最低优惠</text><text wx:else>您已经享最低优惠</text></text>  
179 - <text class='gred' wx:else>还差<text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text>人成团 </text>  
180 - <view class="t_show">  
181 - 剩余  
182 - <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text>  
183 - <text>{{timer[t_ind].hou}}</text>:  
184 - <text>{{timer[t_ind].min}}</text>:  
185 - <text>{{timer[t_ind].sec}}</text>  
186 - </view>  
187 - </view>  
188 - </view> -->  
189 - <!--//参加团-->  
190 - <!-- <view class='cjt t-c'>  
191 - 去参团  
192 - </view>  
193 - <view class="clear"></view>  
194 - </view>  
195 - </view>  
196 - </view>  
197 -  
198 - <view class="pt_fir se1">  
199 - <view class="pt_hb">  
200 - 拼团玩法  
201 - <view class="ptgz_an xq flex" bindtap="show_pt_xx">查看详细  
202 - <view class="bg_right arrow-two"></view>  
203 - </view>  
204 - </view>  
205 - <view class="flex-level" style='height:198rpx; width:100%;'>  
206 - <view class="flex-vertical-between rel" style='width:94%;margin-left:10rpx;'> -->  
207 - <!-- 许程 7: 24 -->  
208 - <!-- <view class="xc-item t-c">  
209 - <view class="circle yuan t-c circle-color">1</view>  
210 - <view class="word">选择商品完成下单</view>  
211 - </view>  
212 - <view class="abs link {{color_type==0?'link-color-red':'link-color'}}"></view>  
213 -  
214 - <view class="xc-item t-c">  
215 - <view class="circle yuan t-c circle-color">2</view>  
216 - <view class="word">支付开团或参团</view>  
217 - </view>  
218 - <view class="abs link1 {{color_type_one==0?'link-color-red':'link-color'}}"></view>  
219 -  
220 - <view class="xc-item t-c">  
221 - <view class="circle yuan t-c circle-color">3</view>  
222 - <view class="word">邀请好友参团支付</view>  
223 - </view>  
224 - <view class="abs link2 {{color_type_two==0?'link-color-red':'link-color'}}"></view>  
225 -  
226 -  
227 - <view class="xc-item t-c">  
228 - <view class="circle yuan t-c circle-color1">4</view>  
229 - <view class="word">人满发货失败退款</view>  
230 - </view>  
231 - </view>  
232 - </view>  
233 - </view>  
234 - </view> -->  
235 -  
236 - <!-- 积分购 -->  
237 - <!-- <view wx:if="{{prom_type==4}}">  
238 - <view class="goods-price rel"> -->  
239 - <!-- 价格显示 -->  
240 - <!-- <view class="co-red" style="overflow: hidden" >  
241 - <view class="market-price" style="overflow: hidden; height: 66rpx;">  
242 - <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>  
243 - <block wx:if="{{prom_integral}}">{{prom_integral}}  
244 - <text class="rel_txt">积分</text></block>  
245 - <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>  
246 - <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>  
247 - <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>  
248 - <text class="rel_txt" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>  
249 - </view>  
250 - </view> -->  
251 -  
252 - <!-- 这个是分享按钮 -->  
253 - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">  
254 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
255 - <view class="share-font">分享</view>  
256 - </view>  
257 -  
258 - <view class="goods-title">  
259 - <view class="goods-name elli">{{data.goods_name}}</view>  
260 - </view>  
261 -  
262 - <view class="goods-num">  
263 - <view class="sales">销量:{{prom_act.buy_num}}件</view> -->  
264 - <!-- <view class="stock">折扣:{{data.disc}}折</view> -->  
265 - <!-- <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*100/data.shop_price)}}折</view>  
266 - <view class="stock">{{categories3[0].num}}人评价</view>  
267 - </view>  
268 - </view>  
269 - </view> -->  
270 -  
271 - <!-- 不是拼团,不是积分购 -->  
272 <block> 30 <block>
273 - <!-- <block wx:if="{{prom_type!=6 && prom_type!=4}}"> --> 31 +
274 <view class="goods-price rel"> 32 <view class="goods-price rel">
275 - <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}">  
276 - <view class="market-price" style="overflow: hidden">  
277 - <!-- <block wx:if="{{card_field && data[card_field]>0}}">  
278 - <view class="flex ai-center grade-card-frame" style="margin-left:12rpx;">  
279 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
280 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
281 - </view>  
282 - <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}  
283 - <view class='yj' style="top:35rpx">  
284 - <text>零售价:¥{{data.market_price}}</text>  
285 - </view>  
286 - </block> -->  
287 - <!-- <block wx:else>  
288 - <text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}  
289 - <view class='yj'><text>零售价:¥{{data.market_price}}</text></view>  
290 - </block> -->  
291 - </view>  
292 - 33 + <view class="co-red" style="overflow: hidden">
  34 + <view class="market-price" style="overflow: hidden"></view>
293 </view> 35 </view>
294 -  
295 - <!-- 这个是分享按钮 -->  
296 - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">  
297 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
298 - <view class="share-font">分享</view>  
299 - </view> -->  
300 -  
301 - <!-- 不是秒杀 -->  
302 - <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->  
303 - <!-- <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 }}">  
304 -  
305 - <view class="flex ai-center grade-card-frame card-frame" >  
306 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
307 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
308 - </view>  
309 - <view class="fs32 xc-black3 ai_and carde_frame">  
310 - <text class="fs26">  
311 - ¥</text>{{g_filters.get_card_price(data,card_list,0)}}  
312 - </view>  
313 - </view> -->  
314 -  
315 - <!-- 等级卡的显示,购买, 等级卡近30天要显示续费-->  
316 -  
317 - <!-- <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> -->  
318 -  
319 - <!-- 不是秒杀,且会员不是等级会员 -->  
320 - <!-- <view wx:if="{{!card_field && prom_type!=1 }}">  
321 - <view class="beauty-makeup-frame flex ai-center">  
322 - <view class="left flex ai-center">  
323 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
324 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
325 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
326 - </view>  
327 - <view class="card-effect">  
328 - <view class="fs24 xc-black3">成为{{g_filters.get_card_price(data,card_list,1)}}立<text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元</view>  
329 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
330 - </view>  
331 - </view>  
332 - <view class="right flex jc-center ai-center" bindtap="go_plus">  
333 - <view class="at_once_carde xc-black3 fs28">立即开卡</view>  
334 - <view class="bg_right"></view>  
335 - </view>  
336 -  
337 - </view>  
338 - </view> -->  
339 - <!-- 立即续费的显示 -->  
340 - <!-- <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}">  
341 - <view class="beauty-makeup-frame flex ai-center">  
342 - <view class="left flex ai-center">  
343 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
344 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
345 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
346 - </view>  
347 - <view class="card-effect">  
348 - <view class="fs24 xc-black3">成为{{card_name}}立<text class="co-red">省{{filters.toFix(data.shop_price[card_field],2)}}</text>元</view>  
349 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
350 - </view>  
351 - </view>  
352 - <view class="right flex jc-center ai-center" bindtap="go_card_info">  
353 - <view class="at_once_carde xc-black3 fs28">立即续费</view>  
354 - <view class="bg_right"></view>  
355 - </view>  
356 -  
357 - </view>  
358 -  
359 - </view> -->  
360 -  
361 - <!-- </block> -->  
362 - <!--许程商品名字-->  
363 -  
364 - <!-- <view wx:if="{{prom_type!=1}}"> --> 36 +
365 <view> 37 <view>
366 - <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view>  
367 - <view class="goods-title">  
368 - <view class="goods-name elli">{{data.goods_name}}</view>  
369 - </view> 38 + <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
  39 + <view class="goods-title"> <view class="goods-name elli">{{data.goods_name}}</view></view>
370 </view> 40 </view>
371 -  
372 - <view class="goods-num" wx:if="{{prom_type!=1}}">  
373 - <view class="sales">耗时:{{data.sales_sum}}</view>  
374 - <view class="stock">次数:{{data.disc}}</view>  
375 - <!-- <view class="stock">折扣:{{filters.pInt((prom_price?prom_price:0)*100/data.shop_price)}}折</view> -->  
376 - <view class="stock">有效天数:{{data.validDays}}</view>  
377 - <!-- <view class="stock">有效天数:1234{{categories3[0].num}}</view> -->  
378 - </view>  
379 - <!-- <view wx:if="{{prom_type==1}}">  
380 - <view class="flex">  
381 - <view>  
382 - <view class="flex xc-price-frame">  
383 - <view class="flex fs45 sign">¥</view>  
384 - <view class="fs60 val">{{prom_price}}</view>  
385 - </view>  
386 - <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view>  
387 - </view>  
388 - <view class="xc-val-price">  
389 - <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>  
390 - <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>  
391 - <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>  
392 - </view>  
393 - </view>  
394 - </view> -->  
395 -  
396 - <!-- <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">  
397 - {{data.goods_name}}  
398 - </view> -->  
399 -  
400 - <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->  
401 - <!-- 许程 7.24 暂时注释 -->  
402 - <!-- <view wx:if="{{prom_type==1}}">  
403 - <view class="goods-num" wx:if="{{prom_type==1}}">  
404 -  
405 - <block wx:if="prom_st>0" >  
406 - <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>  
407 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
408 - <block wx:if="{{prom_st==0}}">  
409 - <view class="sales">已购:0件</view>  
410 - </block>  
411 - <block wx:else>  
412 - <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view>  
413 - </block>  
414 - </block>  
415 -  
416 - <block wx:else>  
417 - <view class="stock">总数量:{{prom_act.goods_num}}件</view>  
418 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
419 - <view class="sales">已购:{{prom_act.buy_num}}件</view>  
420 - </block>  
421 -  
422 - </view>  
423 - </view> -->  
424 - 41 +
  42 + <view class="goods-num" style="margin-bottom: 10rpx;">
  43 + <view class="sales">销量:{{data.sales_sum}}</view>
  44 + <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view>
  45 + </view>
  46 +
425 </view> 47 </view>
426 </block> 48 </block>
427 49
428 <!-- 门店收货地址 --> 50 <!-- 门店收货地址 -->
429 - <!-- <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > 51 + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >
430 <view class="address_frame" bindtap="choice_store" data-ind="0"> 52 <view class="address_frame" bindtap="choice_store" data-ind="0">
431 <view class="flex-vertical-between "> 53 <view class="flex-vertical-between ">
432 <view class="flex-vertical select_store_height"> 54 <view class="flex-vertical select_store_height">
@@ -449,14 +71,12 @@ @@ -449,14 +71,12 @@
449 71
450 </view> 72 </view>
451 </view> 73 </view>
452 -  
453 -  
454 - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> 74 +
  75 + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view>
455 <block wx:else> 76 <block wx:else>
456 - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> 77 + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view>
457 <block wx:else> 78 <block wx:else>
458 - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>  
459 - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> 79 + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(该门店无此项目)</view>
460 </block> 80 </block>
461 </block> 81 </block>
462 82
@@ -464,226 +84,39 @@ @@ -464,226 +84,39 @@
464 </view> 84 </view>
465 </view> 85 </view>
466 86
467 - </view> -->  
468 -  
469 - <!--许程 7.24暂时注释 -->  
470 - <!-- <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}">  
471 - <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">  
472 - <view class="cx-sizs fs30">领券</view>  
473 - <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}">  
474 - <view class="circle xc-circular xc-one"></view>  
475 - <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view>  
476 - <view class="circle xc-circular xc-two"></view>  
477 - </view>  
478 -  
479 - <view data-coupon="1" bindtap="switchCoupon" class="cx-obtain-coupon wsize">  
480 - <text class="bg_jj"></text>  
481 - </view>  
482 - </view>  
483 - </view> -->  
484 -  
485 - <!-- 要判断是不是有促销活动 -->  
486 - <!-- <block wx:if="{{prom_goods}}">  
487 - <view class="cx-frame flex" style="position: relative; height: auto" >  
488 - <view class="cx-sizs wsize">促销</view> -->  
489 - <!-- 中间显示层 -->  
490 - <!-- <view style="margin-top: 36rpx">  
491 - <view class="cx_show_view flex fs28" wx:for="{{prom_goods}}">  
492 - <view class="prom_condition">消费满{{item.condition}}<text wx:if="{{item.prom_type==1}}">件</text><text wx:else>元</text></view>  
493 - <view class="word {{is_more_cx?'':'ellipsis-1'}}">  
494 - <text wx:if="{{item.money>0}}">减价{{item.money}}元;</text>  
495 - <text wx:if="{{item.sale>0}}">打{{item.sale}}折;</text>  
496 - <text wx:if="{{item.past==1}}">包邮;</text>  
497 - <text wx:if="{{item.intValue>0}}">送{{tem.intValue}}积分;</text>  
498 - <text wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券;</text>  
499 - <text wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}};</text>  
500 - <text wx:if="{{item.lb_id>0}}">送{{item.lbtitle}};</text>  
501 - </view>  
502 - </view>  
503 -  
504 - </view>  
505 - <view data-coupon="1" bindtap="show_more_cx" class="cx-obtain-coupon wsize">  
506 - <text class="bg_jj {{is_more_cx?'down1':''}}"></text>  
507 - </view>  
508 - </view>  
509 - </block> -->  
510 -  
511 - <!-- 要判断是不是有订单优惠 -->  
512 - <!-- <block wx:if="{{order_prom}}">  
513 - <view class="cx-frame flex" style="position: relative; height: auto" >  
514 - <view class="cx-sizs wsize" style="width: 144rpx">订单优惠</view> -->  
515 - <!-- 中间显示层 -->  
516 - <!-- <view class="flex ai-center">  
517 - <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>  
518 - <view class="order_hui">  
519 - <view class="fs28 ellipsis-1">{{order_prom.name}}</view>  
520 - <view class="fs26" >(活动时间:{{tool.format_tt(order_prom.start_time)}} - {{tool.format_tt(order_prom.end_time)}})</view>  
521 - </view>  
522 - </view>  
523 - </view>  
524 - </block> -->  
525 -  
526 -  
527 - <!-- <view class="bz_view flex ai-center bdt16" wx:if="{{bconfig}}" style="line-height: 36rpx">  
528 - <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>  
529 - <view class="bz-content">{{bconfig.service_bz}}</view>  
530 - </view> -->  
531 -  
532 -  
533 - <!--- 搭配促销 ---->  
534 - <!-- <view class="dp_cx_view" wx:if="{{collocationGoods}}">  
535 - <view class="bb_view">  
536 - <view>优惠热配</view>  
537 - <view class="red_bb" bindtap="go_prom_list">查看全部  
538 - <text class="bg_jj"></text>  
539 - </view>  
540 - </view> -->  
541 -  
542 - <!-- 搭配的显示 -->  
543 - <!-- <view class="flex" bindtap="go_prom_list">  
544 - <image class="dp_img" src="{{iurl+collocationGoods.img_url}}"></image>  
545 - <view class="act_content">  
546 - <view class="fs32">{{collocationGoods.title}}</view>  
547 - <view class="fs30 color_b" wx:if="{{collocationGoods.max!=collocationGoods.min}}">搭配价¥{{collocationGoods.min}}-{{collocationGoods.max}}</view>  
548 - <view class="fs30 color_b" wx:else>搭配价¥{{collocationGoods.min}}</view>  
549 - <view class="fs30 color-gray">活动至{{filters.format_time(collocationGoods.end_time,1)}}</view>  
550 - </view>  
551 - </view> -->  
552 - <!-- </view> -->  
553 -  
554 -  
555 - <!--- 宝贝评价 ---->  
556 - <!-- <view class="bdt16" style="overflow: hidden">  
557 - <view class="bb_view">  
558 - <view>宝贝评价({{categories3[0].num}})</view>  
559 - <view class="red_bb" bindtap="look_pj">查看全部  
560 - <text class="bg_jj"></text>  
561 - </view>  
562 - </view>  
563 -  
564 - <view class="xc_comment">  
565 - <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">有图({{categories3[1].num}}) </view>  
566 - <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">好评({{categories3[2].num}}) </view>  
567 - <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">中评({{categories3[3].num}}) </view>  
568 - <view class="xc_comment-discuss" data-val="4"bindtap="clik_evaluate">差评({{categories3[4].num}}) </view>  
569 - </view>  
570 -  
571 - <scroll-view scroll-x="true" class="pj_scroll">  
572 -  
573 - <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments">  
574 - <view class="xc_comment-left">  
575 - <view class="xc_comment-user">  
576 - <view class="xc_user-img">  
577 - <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>  
578 - </view>  
579 -  
580 - <view class="xc_user">  
581 - <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>  
582 - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>  
583 - </view>  
584 - </view>  
585 - <view class="xc_comment-font pj_word_size ellipsis-2">  
586 - {{item.content?item.content:''}}  
587 - </view>  
588 - <view class="xc_comment-val">  
589 - <view class="xc_comment-time">{{item.add_time}}</view>  
590 -  
591 - </view>  
592 - </view>  
593 - <view class="xc_goods-img-frame">  
594 - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>  
595 - <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>  
596 - <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>  
597 - </view>  
598 - </view>  
599 -  
600 - </scroll-view>  
601 - </view> --> 87 + </view>
602 88
  89 +
603 <!-- 图文详情 --> 90 <!-- 图文详情 -->
604 <view> 91 <view>
605 - <view class="tuwen_title"> 92 + <view class="tuwen_title">
606 <view class="g_line"></view> 93 <view class="g_line"></view>
607 <view class="center_s"> 94 <view class="center_s">
608 - <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image>  
609 - <text>详情</text>  
610 - </view>  
611 - </view>  
612 - <view>{{data.serviceContent}}</view>  
613 - <!-- <view class="t_g_info">  
614 - <view class="red_shu"></view>  
615 - <view class="fs30">商品信息</view>  
616 - </view> -->  
617 - <!-- <view class="table_s">  
618 - <view class="tb_item tb-l">  
619 - <view class="item_left">  
620 - <text>商品名称</text>  
621 - </view>  
622 - <view class="item_right">  
623 - <text>{{data.goods_name}}</text>  
624 - </view>  
625 - </view>  
626 - <view class="tb_item tb-l">  
627 - <view class="item_left">  
628 - <text>商品编号</text>  
629 - </view>  
630 - <view class="item_right">  
631 - <text>{{data.goods_sn}}</text>  
632 - </view>  
633 - </view>  
634 - <view class="tb_item tb-l">  
635 - <view class="item_left">  
636 - <text>商品条码</text>  
637 - </view>  
638 - <view class="item_right">  
639 - <text>{{data.sku}}</text>  
640 - </view>  
641 - </view>  
642 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
643 - <view class="item_left">  
644 - <text>品类</text>  
645 - </view>  
646 - <view class="item_right">  
647 - <text>{{cat_name}}</text>  
648 - </view>  
649 - </view>  
650 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
651 - <view class="item_left">  
652 - <text>品牌</text>  
653 - </view>  
654 - <view class="item_right">  
655 - <text>{{brand_name}}</text>  
656 - </view>  
657 - </view>  
658 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
659 - <view class="item_left">  
660 - <text>国别</text>  
661 - </view>  
662 - <view class="item_right">  
663 - <text>{{nation_name}}</text>  
664 - </view>  
665 - </view>  
666 - <view class="tb_item tb-l">  
667 - <view class="item_left">  
668 - <text>规格</text>  
669 - </view>  
670 - <view class="item_right">  
671 - <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text>  
672 - </view>  
673 - </view>  
674 - <view class="tb_item tb-l">  
675 - <view class="item_left">  
676 - <text>上架时间</text>  
677 - </view>  
678 - <view class="item_right">  
679 - <text>{{data.on_time}}</text>  
680 - </view>  
681 - </view>  
682 - </view> -->  
683 - <!--详情图片-->  
684 - <!-- <view class="wxParse">  
685 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>  
686 - </view> --> 95 + <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image><text>详情</text>
  96 + </view>
  97 + </view>
  98 +
  99 + <view wx:if="{{service_list}}">
  100 + <view class="goods-num" style="font-size: 26rpx; background-color: #f6f5f4;">
  101 + <view class="stock">项目名称</view>
  102 + <view class="stock">耗时(分)</view>
  103 + <view class="stock">手工费</view>
  104 + <view class="stock">次数</view>
  105 + </view>
  106 + <block wx:for="{{service_list}}">
  107 + <view class="goods-num" style="margin-bottom: 10rpx;font-size: 22rpx;">
  108 + <view class="stock">{{item.projectName}}</view>
  109 + <view class="stock">{{item.timeConsuming}}</view>
  110 + <view class="stock">{{item.money}}</view>
  111 + <view class="stock">{{item.frequency}}</view>
  112 + </view>
  113 + </block>
  114 + </view>
  115 +
  116 + <view class="wxParse">
  117 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  118 + </view>
  119 +
687 </view> 120 </view>
688 121
689 <!-- 推荐商品 --> 122 <!-- 推荐商品 -->
@@ -694,168 +127,19 @@ @@ -694,168 +127,19 @@
694 </image> 127 </image>
695 <view class="xc-recommend-word">推荐</view> 128 <view class="xc-recommend-word">推荐</view>
696 </view> 129 </view>
697 - </view>  
698 - 130 + </view>
699 <goods_recommend id="goods_list"></goods_recommend> --> 131 <goods_recommend id="goods_list"></goods_recommend> -->
700 132
701 </view> 133 </view>
702 134
703 - <!------------商品详情图片页面---------------->  
704 - <!-- <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">  
705 - <view class="table_s">  
706 - <view class="tb_item tb-l">  
707 - <view class="item_left">  
708 - <text>商品名称</text>  
709 - </view>  
710 - <view class="item_right">  
711 - <text>{{data.goods_name}}</text>  
712 - </view>  
713 - </view>  
714 - <view class="tb_item tb-l">  
715 - <view class="item_left">  
716 - <text>商品编号</text>  
717 - </view>  
718 - <view class="item_right">  
719 - <text>{{data.goods_sn}}</text>  
720 - </view>  
721 - </view>  
722 - <view class="tb_item tb-l">  
723 - <view class="item_left">  
724 - <text>商品条码</text>  
725 - </view>  
726 - <view class="item_right">  
727 - <text>{{data.sku}}</text>  
728 - </view>  
729 - </view>  
730 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
731 - <view class="item_left">  
732 - <text>品类</text>  
733 - </view>  
734 - <view class="item_right">  
735 - <text>{{cat_name}}</text>  
736 - </view>  
737 - </view>  
738 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
739 - <view class="item_left">  
740 - <text>品牌</text>  
741 - </view>  
742 - <view class="item_right">  
743 - <text>{{brand_name}}</text>  
744 - </view>  
745 - </view>  
746 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
747 - <view class="item_left">  
748 - <text>国别</text>  
749 - </view>  
750 - <view class="item_right">  
751 - <text>{{nation_name}}</text>  
752 - </view>  
753 - </view>  
754 - <view class="tb_item tb-l">  
755 - <view class="item_left">  
756 - <text>规格</text>  
757 - </view>  
758 - <view class="item_right">  
759 - <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text>  
760 - </view>  
761 - </view>  
762 - <view class="tb_item tb-l">  
763 - <view class="item_left">  
764 - <text>上架时间</text>  
765 - </view>  
766 - <view class="item_right">  
767 - <text>{{data.on_time}}</text>  
768 - </view>  
769 - </view>  
770 - </view>  
771 -  
772 - <view class="wxParse">  
773 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>  
774 - </view>  
775 - </view> -->  
776 - <!---------------评价页面-------------->  
777 - <!-- <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">  
778 - <view class="topframe">  
779 - <view class="topframe-top">  
780 - <view class="topframe-top-content">  
781 - <view>宝贝评价</view>  
782 - <view class="topframe-top-val">({{categories3[0].num}})</view>  
783 - </view>  
784 - <view class="topframe-praise" wx:if="{{categories3[0].num}}">好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%</view>  
785 - <view wx:else>好评 0%</view>  
786 - </view>  
787 - <view class="buttem-list">  
788 - <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">{{item.name}}({{item.num}})</view>  
789 - </view>  
790 - </view>  
791 -  
792 - <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">  
793 - <view style='border-bottom:4rpx solid #eee;'>  
794 - <view class="middle">  
795 - <view class="middle-img-frame">  
796 - <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>  
797 - <view class="middle-user-frame">  
798 - <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view>  
799 - <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>  
800 - </view>  
801 - </view>  
802 - <view class="xc-pirces">  
803 - <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >  
804 - {{item.content?item.content:''}}  
805 - </view>  
806 - </view>  
807 - <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>  
808 - <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>  
809 - <view class="img-ul">  
810 -  
811 - <block wx:if="{{item.source_type==0}}">  
812 - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">  
813 - <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}"  
814 - data-id="{{index}}" src="{{iurl}}{{item}}"></image>  
815 - </view>  
816 - </block>  
817 - <block wx:if="{{item.source_type==1}}">  
818 - <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">  
819 - <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}"  
820 - data-id="{{index}}" src="{{aitem}}"></image>  
821 - </view>  
822 - </block>  
823 - </view>  
824 -  
825 - <view class="z_parameter">  
826 - <view class="parameter-font">{{item.add_time}}</view>  
827 - <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">  
828 - <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>  
829 - <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>  
830 - <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}' >{{item.zan_num}}</view>  
831 - </view>  
832 - </view>  
833 -  
834 - </view>  
835 - <view class="reply rel" wx:if="{{item.replay_list}}">  
836 - <view class="line_bulge"></view>  
837 - <view class="shop-reply">店家回复: </view>  
838 - <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">  
839 - {{r_item.content}}  
840 - </view>  
841 - </view>  
842 - </view>  
843 - </block>  
844 - <block wx:if="{{(!comments || comments.length==0) && get_c }}">  
845 - <text class="no_pj_list">暂无评价</text>  
846 - </block>  
847 - <block wx:if="{{comments.length>10 && comments_no_more}}">  
848 - <text class="no_pj_list">已经加载到底部</text>  
849 - </block>  
850 - </view> -->  
851 - </view> 135 + </view>
852 </view> 136 </view>
853 <!---滚动到顶部----> 137 <!---滚动到顶部---->
854 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> 138 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
855 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> 139 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
856 </view> 140 </view>
857 141
858 - <!-------------------底部按钮--------------------> 142 + <!-- 底部按钮 -->
859 <view class="join-cart"> 143 <view class="join-cart">
860 <!-- bindtap="contactService" --> 144 <!-- bindtap="contactService" -->
861 <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 145 <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
@@ -867,11 +151,6 @@ @@ -867,11 +151,6 @@
867 <view>客服</view> 151 <view>客服</view>
868 </view> 152 </view>
869 153
870 - <view bindtap="collectGoods" class="custom-service cart-ico new_split">  
871 - <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>  
872 - <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>  
873 - <view>收藏</view>  
874 - </view>  
875 <view class="shopping-cart cart-ico new_split"> 154 <view class="shopping-cart cart-ico new_split">
876 <navigator open-type="switchTab" url="/pages/cart/cart/cart"> 155 <navigator open-type="switchTab" url="/pages/cart/cart/cart">
877 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 156 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
@@ -879,429 +158,148 @@ @@ -879,429 +158,148 @@
879 <view>购物车</view> 158 <view>购物车</view>
880 </navigator> 159 </navigator>
881 </view> 160 </view>
882 - <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>  
883 -  
884 - <!-- 普通商品购买 -->  
885 - <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">  
886 -  
887 - <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->  
888 - <!-- <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}"> --> 161 +
889 <block> 162 <block>
890 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
891 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>  
892 - </block>  
893 - <!-- <block wx:else>  
894 - <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">库存不足</view>  
895 - </block> -->  
896 - 163 + <!-- <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> -->
  164 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn" style="width: 64%; border-radius: 56rpx;">立即购买</view>
897 </block> 165 </block>
898 -  
899 - <!-------秒杀-------->  
900 - <!-- <block wx:if="{{prom_type==1}}">  
901 - <block wx:if="{{prom_st==1 && !prom_r_null}}">  
902 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
903 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view>  
904 - </block>  
905 - <block wx:if="{{prom_st==0 && !prom_r_null}}">  
906 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">即将开始</view>  
907 - </block>  
908 - <block wx:if="{{prom_r_null}}">  
909 - <view class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view>  
910 - </block>  
911 - <block wx:if="{{prom_st==3 && !prom_r_null}}">  
912 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view>  
913 - </block>  
914 - </block> -->  
915 -  
916 - <!-------拼单-------->  
917 - <!-- <block wx:if="{{prom_type==6}}"> -->  
918 - <!-- <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h">  
919 - <view class="fir-v"> -->  
920 - <!-- ¥{{data.shop_price,2)}} -->  
921 - <!-- <block wx:if="{{card_field && sele_g[card_field]>0}}">  
922 - {{filters.toFix(sele_g[card_field],2)}}  
923 - </block>  
924 - <block wx:else>  
925 - {{filters.toFix(sele_g.shop_price,2)}}  
926 - </block>  
927 - </view>  
928 - <view>单独购买</view>  
929 - </view> -->  
930 -  
931 - <!-- <block wx:if="{{user_order_pt_state==0}}"> -->  
932 - <!----商家团---->  
933 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h">  
934 - <view class="fir-v">¥{{prom_act.price}}</view>  
935 - <view>去参团</view>  
936 - </view> -->  
937 - <!----会员团---->  
938 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> -->  
939 - <!--<view class="fir-v">¥{{prom_act.price}}</view>-->  
940 - <!-- <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}">  
941 - <view>一键开团</view>  
942 - <view wx:if="{{prom_act.tz_yhjgtype==3}}">佣金<text style="font-size: 23rpx">¥</text>{{filters.toFix(prom_act.tz_yyhjg,2)}}</view>  
943 - <view wx:if="{{prom_act.tz_yhjgtype==2}}">团长免单</view>  
944 - </view>  
945 - <view wx:else>  
946 - <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view>  
947 - <view>一键开团</view>  
948 - </view> -->  
949 -  
950 - <!-- </view> -->  
951 - <!---阶梯团---->  
952 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h">  
953 - <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view>  
954 - <view>支付定金</view>  
955 - </view>  
956 -  
957 - <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view>  
958 - <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view>  
959 - <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view>  
960 - </block>  
961 - <block wx:else>  
962 - <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise">您还未支付</view>  
963 - <view bindtap="go_to_team_show" wx:if="{{user_order_pt_state==2}}" class="buy-btn cart-btn">查看支付详情</view>  
964 - <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>  
965 - </block> -->  
966 - <!-- </block> -->  
967 -  
968 -  
969 - <!-------积分购-------->  
970 - <!-- <block wx:if="{{prom_type==4}}">  
971 -  
972 - <block wx:if="{{is_shopbuy}}">  
973 - <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">  
974 - <view class="fir-v">  
975 - <block wx:if="{{card_field && sele_g[card_field]>0}}">  
976 - {{filters.toFix(sele_g[card_field],2)}}  
977 - </block>  
978 - <block wx:else>  
979 - {{filters.toFix(sele_g.shop_price,2)}}  
980 - </block>  
981 - </view>  
982 - <view>单独购买</view>  
983 - </view>  
984 - <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>  
985 - <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >积分不足</view>  
986 - </block>  
987 -  
988 - <block wx:else>  
989 - <view bindtap="go_pay_integral" class="buy-btn-all cart-btn" style="width: 58%; margin-left:1%;" wx:if="{{can_integral}}" >立即兑换</view>  
990 - <view class="buy-btn-all cart-btn" style="background-color: #aaa; width: 58%;margin-left:1%" wx:else >积分不足</view>  
991 - </block>  
992 -  
993 - </block> -->  
994 -  
995 - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>--> 166 +
996 </view> 167 </view>
997 168
998 <!-- 制作一个圆球导航 --> 169 <!-- 制作一个圆球导航 -->
999 <nav_box></nav_box> 170 <nav_box></nav_box>
1000 -  
1001 </block> 171 </block>
1002 172
1003 -<!----弹起来,选择规格数量,普通商品购买和秒杀------> 173 +<!-- 弹起来,选择规格数量,普通商品购买和秒杀 -->
1004 <view hidden="{{!openSpecModal}}"> 174 <view hidden="{{!openSpecModal}}">
1005 <view bindtap="closeSpecModal" class="cover-layer"></view> 175 <view bindtap="closeSpecModal" class="cover-layer"></view>
1006 <view class="spec-model"> 176 <view class="spec-model">
1007 <view class="pding"> 177 <view class="pding">
1008 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> 178 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
1009 <view class="spec-goods"> 179 <view class="spec-goods">
1010 - <image class="wh100 spec-img" src="{{iurl + data.image_url}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"/> 180 + <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" binderror="pop_err_img" data-errorimg="data.image_url"/>
1011 <view class="spec-goods-info"> 181 <view class="spec-goods-info">
1012 - <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>  
1013 - <!-- <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> -->  
1014 - <view class="flex ai_end xc-val-money" >  
1015 - <view class="spec-goods-price" wx:if="{{prom_price==null}}" >  
1016 - <text class="fs20">¥</text>  
1017 - <!-- 如果是等级会员,且有等级价 -->  
1018 - <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>  
1019 - <!-- <block wx:else>{{sele_g.shop_price}}</block> -->  
1020 - <block wx:else>{{data.shop_price}}</block>  
1021 - </view>  
1022 - <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>  
1023 - <!-- 显示线下价格 -->  
1024 - <!-- <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">  
1025 - 券后¥<text class="fs32">{{sele_g.offline_price}}</text>  
1026 - </view> -->  
1027 - </view>  
1028 -  
1029 - <!-- <block wx:if="{{prom_type==0}}">  
1030 - <view class="flex">  
1031 - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>  
1032 - <block wx:if="{{sales_rules==2}}">  
1033 - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>  
1034 - <view class="spec-goods-stock" wx:else>可售:0</view>  
1035 - </block>  
1036 - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>  
1037 - </view>  
1038 - </block> -->  
1039 - <!-- <block wx:if="{{prom_type==1}}">  
1040 - <view class="flex">  
1041 - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>  
1042 - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>  
1043 - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>  
1044 - </view>  
1045 - </block> -->  
1046 - </view>  
1047 -  
1048 - <!-- 选择门店模块 -->  
1049 - <!-- <view class="flex-space-between address ai_end xc-width ">  
1050 -  
1051 - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">  
1052 - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>  
1053 - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">  
1054 - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}  
1055 -  
1056 - </view>  
1057 - </view> -->  
1058 -  
1059 - <!-- 没有门店的时候 -->  
1060 - <!-- <view class="flex" bindtap="choice_store" wx:else>  
1061 - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>  
1062 - <view class="fs30" style="color:black;">选择门店</view>  
1063 - </view>  
1064 -  
1065 - <view class="red-co fs28" bindtap="choice_store" >  
1066 - 更多门店  
1067 - <text class="right-arrow"></text>  
1068 - </view>  
1069 - </view> -->  
1070 - <!-- <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>  
1071 - <block wx:else>  
1072 - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>  
1073 - <block wx:else>  
1074 - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>  
1075 - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>  
1076 - </block>  
1077 - </block> -->  
1078 -  
1079 - <!-- <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> -->  
1080 - </view> 182 + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
  183 + <view class="flex ai_end xc-val-money" >
  184 + <view class="spec-goods-price"><text class="fs20">¥</text><block wx>{{data.shop_price}}</block></view>
  185 + </view>
  186 + </view>
  187 + </view>
  188 +
  189 + <!-- 选择门店模块 -->
  190 + <view class="flex-space-between address ai_end xc-width" style="margin-top: 30rpx;">
  191 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  192 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  193 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  194 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  195 +
  196 + </view>
  197 + </view>
  198 +
  199 + <!-- 没有门店的时候 -->
  200 + <view class="flex" bindtap="choice_store" wx:else>
  201 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  202 + <view class="fs30" style="color:black;">选择门店</view>
  203 + </view>
  204 +
  205 + <view class="red-co fs28" bindtap="choice_store" >
  206 + 更多门店
  207 + <text class="right-arrow"></text>
  208 + </view>
  209 + </view>
  210 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  211 + <block wx:else>
  212 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  213 + <block wx:else>
  214 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(该门店无此项目)</view>
  215 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  216 + </block>
  217 + </block>
  218 +
  219 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  220 + </view>
1081 221
1082 - <!--商品的属性项目-->  
1083 - <!-- <view class="xc-goods-attribute">  
1084 - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>  
1085 - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">  
1086 - <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">  
1087 - {{item.gg}}  
1088 - </view>  
1089 - </view>  
1090 - </view> -->  
1091 - 222 +
1092 223
1093 - <view class="b_num"> 224 + <view class="b_num">
1094 <view>购买数量</view> 225 <view>购买数量</view>
1095 <view class="count"> 226 <view class="count">
1096 - <view bindtap="subCartNum" class="sub">-</view>  
1097 - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>  
1098 - <view bindtap="addCartNum" class="add">+</view> 227 + <view bindtap="subCartNum" class="sub">-</view>
  228 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  229 + <view bindtap="addCartNum" class="add">+</view>
1099 </view> 230 </view>
1100 - </view>  
1101 -  
1102 - <!-- 提示再买多少优惠 -->  
1103 - <!-- <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">  
1104 - 再买{{hui_condition.need}}  
1105 - <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>  
1106 - <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>  
1107 - <text wx:if="{{hui_condition.past==1}}">,包邮</text>  
1108 - <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>  
1109 - <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>  
1110 - <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>  
1111 - <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>  
1112 - </view> -->  
1113 -  
1114 -  
1115 - </view>  
1116 - <!-- <view class="spec-cart-btns"> -->  
1117 - <!-- <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> -->  
1118 - <!-- <block wx:else> --> 231 + </view>
  232 +
  233 +
1119 234
1120 - <!-- 根本就找不到门店 -->  
1121 - <!-- <block wx:if="{{!only_pk && !def_pickpu_list}}">  
1122 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1123 - </block> -->  
1124 - <!-- <block wx:else>  
1125 -  
1126 -  
1127 - <block wx:if="{{only_pk.length && !only_pk.length}}">  
1128 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1129 - </block>  
1130 - <block wx:else>  
1131 - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">  
1132 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1133 - </block>  
1134 - <block wx:else>  
1135 - <block wx:if="{{!def_pick_store}}">  
1136 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>  
1137 - </block>  
1138 - <block wx:else> -->  
1139 - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->  
1140 - <!-- <block wx:if="{{sales_rules==2 && prom_type==0}}">  
1141 - <block wx:if="{{!def_pick_store.CanOutQty}}">  
1142 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1143 - </block>  
1144 - <block wx:else>  
1145 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1146 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1147 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1148 - class="spec-cart-btn spec-buy" data-action="buy">  
1149 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1150 - </view>  
1151 - </block>  
1152 - </block> -->  
1153 - <!-- 线上销售 -->  
1154 - <!-- <block wx:else>  
1155 - <block wx:if="{{sele_g.store_count<=0}}">  
1156 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1157 - </block>  
1158 - <block wx:else>  
1159 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1160 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1161 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1162 - class="spec-cart-btn spec-buy" data-action="buy">  
1163 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1164 - </view>  
1165 - </block>  
1166 - </block> -->  
1167 - <!-- </block> -->  
1168 - <!-- </block>  
1169 - </block>  
1170 - </block>  
1171 -  
1172 - </block>  
1173 - </view> --> 235 + <view class="spec-cart-btns">
  236 + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add"
  237 + style="background-color: #dcdcdc;color: #999;">该门店无此项目</view>
  238 + <block wx:else>
  239 +
  240 + <!-- 根本就找不到门店 -->
  241 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  242 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  243 + </block>
  244 + <block wx:else>
  245 +
  246 +
  247 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  248 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  249 + </block>
  250 + <block wx:else>
  251 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  252 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  253 + </block>
  254 + <block wx:else>
  255 + <block wx:if="{{!def_pick_store}}">
  256 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  257 + </block>
  258 + <block wx:else>
  259 + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
  260 + <block wx:if="{{sales_rules==2 && prom_type==0}}">
  261 + <block wx:if="{{!def_pick_store.CanOutQty}}">
  262 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  263 + </block>
  264 + <block wx:else>
  265 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  266 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  267 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  268 + class="spec-cart-btn spec-buy" data-action="buy">
  269 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  270 + </view>
  271 + </block>
  272 + </block>
  273 + <!-- 线上销售 -->
  274 + <block wx:else>
  275 + <block wx:if="{{sele_g.store_count<=0}}">
  276 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  277 + </block>
  278 + <block wx:else>
  279 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  280 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  281 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  282 + class="spec-cart-btn spec-buy" data-action="buy">
  283 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  284 + </view>
  285 + </block>
  286 + </block>
  287 + </block>
  288 + </block>
  289 + </block>
  290 + </block>
  291 +
  292 + </block>
  293 + </view>
  294 +
  295 +
1174 296
1175 <view class="clear"></view> 297 <view class="clear"></view>
1176 - <!---选择门店的列表--->  
1177 - <view hidden="{{ismend==0}}" class="sto_v">  
1178 - <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">  
1179 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店  
1180 - </view>  
1181 - <!-----第一级显示------>  
1182 - <!-- <view class="itemlists" hidden="{{is_sec_mend==1}}">  
1183 - <block wx:if="{{is_show_sto_cat}}">  
1184 - <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>  
1185 - </block>  
1186 - <block wx:else>  
1187 - <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}</view>  
1188 - </block>  
1189 - </view> -->  
1190 - <!-----第二级显示------>  
1191 - <!-- <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">  
1192 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}  
1193 - </view> -->  
1194 - <!-- <view class="itemlists" hidden="{{is_sec_mend==0}}">  
1195 - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}  
1196 - </view>  
1197 - </view> -->  
1198 - </view> 298 +
1199 </view> 299 </view>
1200 </view> 300 </view>
1201 301
1202 -<!-- 弹起来,购买积分购 -->  
1203 -<!-- <view hidden="{{!openSpecModal_inte}}">  
1204 - <include src="buy_integral.wxml" />  
1205 -</view> -->  
1206 -<!-- 弹起来,购买积分购的普通购买 -->  
1207 -<!-- <view hidden="{{!openSpecModal_inte_normal}}">  
1208 - <include src="buy_integral_normal.wxml" />  
1209 -</view> -->  
1210 -  
1211 -<!----弹起来,选择规格数量,拼单商品购买------>  
1212 -<!-- <view hidden="{{!openSpecModal_pt}}">  
1213 - <include src="buy_pt.wxml" />  
1214 -</view> -->  
1215 302
1216 -<!----弹起来优惠信息------>  
1217 -<!-- <view hidden="{{!openPromModal}}">  
1218 - <view bindtap="closePromModal" class="cover-layer"></view>  
1219 - <view class="prom-model">  
1220 - <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon>  
1221 - <view class="prom-title">优惠信息</view>  
1222 - <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="{{index}}">  
1223 - <view class="item-title">  
1224 - <text class="prom-item">{{item.title}}</text>  
1225 - </view>  
1226 - <view class="item-mes ellipsis-1">{{item.content}}</view>  
1227 - </view>  
1228 - </view>  
1229 -</view> -->  
1230 -<!----弹起的---->  
1231 -<!-- <block wx:if="{{pd_xx==1}}">  
1232 - <view class="bview"></view>  
1233 - <view class="juzhong">  
1234 - <view class="xq">  
1235 - <view class="title" bindtap="close_pt_xx">拼团玩法介绍  
1236 - <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>  
1237 - </view>  
1238 - <view>1.开团:  
1239 - <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text>  
1240 - </view>  
1241 - <view>2.参团:  
1242 - <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text>  
1243 - </view>  
1244 - <view>3.成团:  
1245 - <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text>  
1246 - </view>  
1247 - <view>4.组团失败:  
1248 - <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text>  
1249 - </view>  
1250 - <view>5.  
1251 - <text class="hs1">组团有效期间内,拼购商品订单不允许取消。 </text>  
1252 - </view>  
1253 - </view>  
1254 - </view>  
1255 -</block> -->  
1256 -<!----弹起领券---->  
1257 -<view wx:if='{{coupon==1}}'>  
1258 - <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view>  
1259 - <view class="cx-popup {{coupon== true ? 'up' : 'down'}} ">  
1260 - <!-- <view class="top-frame">  
1261 - <view class="top two-level-word t-c">  
1262 - 优惠券领取  
1263 - </view>  
1264 - </view> -->  
1265 - <!-- <view class="top-frame">  
1266 - <view class="xc-valid-coupon four-level-word">可以领优惠券</view>  
1267 - </view> -->  
1268 - <view class="xc-frame">  
1269 - <view class="top-frame">  
1270 - <view class="xc-coupon-frame">  
1271 - <!---单张的券--->  
1272 - <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}">  
1273 - <view class="coupon flex">  
1274 - <view class="circle xc-circular-one"></view>  
1275 - <view class="xc-coupon-left ">  
1276 - <view class="flex xc-money-frame">  
1277 - <view class=" xc-money two-level-word xc-rmb">¥</view>  
1278 - <view class="one-level-word xc-money">{{item.money}}</view>  
1279 - </view>  
1280 - <view class="xc-money four-level-word xc-spacing">  
1281 - 满{{item.condition}}元可用  
1282 - </view>  
1283 - </view>  
1284 - <view class="xc-coupon-right flex">  
1285 - <view class="xc-detail-coupon">  
1286 - <view class="four-level-word">订单金额满{{item.condition}}元可用</view>  
1287 - <view class="four-level-word xc-below">{{item.start}}-{{item.end}}</view>  
1288 - </view>  
1289 - <view class="flex-vertical">  
1290 - <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}"  
1291 - data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">{{ item.linging==1?'领取中':'领取'}}</view>  
1292 - </view>  
1293 - </view>  
1294 - <view class="circle xc-circular-two"></view>  
1295 - </view>  
1296 - </view>  
1297 - </view>  
1298 - </view>  
1299 - </view>  
1300 - <view class="cx-confirm flex-center" data-coupon='0' bindtap="switchCoupon">  
1301 - <view class="confirm t-c">确定</view>  
1302 - </view>  
1303 - </view>  
1304 -</view>  
1305 303
1306 <!-- 选择门店的弹框,1.1版最新的 --> 304 <!-- 选择门店的弹框,1.1版最新的 -->
1307 <block wx:if="{{store==1}}"> 305 <block wx:if="{{store==1}}">
@@ -1458,14 +456,9 @@ @@ -1458,14 +456,9 @@
1458 <view class="poster-container"> 456 <view class="poster-container">
1459 <view class="poster-wrapper"> 457 <view class="poster-wrapper">
1460 <view class="poster"> 458 <view class="poster">
1461 - <!-- <view class="poster" bindtap="previewImage"> -->  
1462 - <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>  
1463 - <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>  
1464 - </view>  
1465 - <!-- <view class="btn-container">  
1466 - <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>  
1467 - <button class="btn-share" bindtap="savePic">保存到相册</button>  
1468 - </view> --> 459 + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
  460 + <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>
  461 + </view>
1469 </view> 462 </view>
1470 </view> 463 </view>
1471 </view> 464 </view>
packageA/pages/goodsInfo/goodsInfo.wxss
@@ -348,11 +348,11 @@ image { @@ -348,11 +348,11 @@ image {
348 } 348 }
349 349
350 .join-cart>view { 350 .join-cart>view {
351 - width: 29%; 351 + width: 32%;
352 } 352 }
353 353
354 .join-cart>.new_split { 354 .join-cart>.new_split {
355 - width: 13%; 355 + width: 17%;
356 text-align: center; 356 text-align: center;
357 padding: 0; 357 padding: 0;
358 margin: 0; 358 margin: 0;
@@ -2732,4 +2732,5 @@ button.custom-service::after{ @@ -2732,4 +2732,5 @@ button.custom-service::after{
2732 } 2732 }
2733 .quan_price{ 2733 .quan_price{
2734 background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx; 2734 background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx;
2735 -}  
2736 \ No newline at end of file 2735 \ No newline at end of file
  2736 +}
  2737 +.stock{ width: 25%; height: 60rpx; border: 1rpx solid #eee; text-align: center; line-height: 60rpx;}
2737 \ No newline at end of file 2738 \ No newline at end of file
packageA/pages/goods_share/goods_share.js
@@ -95,6 +95,13 @@ Page({ @@ -95,6 +95,13 @@ Page({
95 /*** 生命周期函数--监听页面显示***/ 95 /*** 生命周期函数--监听页面显示***/
96 onShow: function () { 96 onShow: function () {
97 var th=this; 97 var th=this;
  98 +
  99 +
  100 + this.setData({
  101 + //用来判断是否是分销商,是分销商才显示分成佣金
  102 + is_distribut: app.globalData.userInfo.is_distribut
  103 + });
  104 +
98 getApp().getConfig2(function(rs){ 105 getApp().getConfig2(function(rs){
99 //计算等级价相关 106 //计算等级价相关
100 var swithc_list=rs.switch_list; 107 var swithc_list=rs.switch_list;
packageA/pages/goods_share/goods_share.wxml
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 77
78 <view class="flex jc_sb fs24 pdt14"> 78 <view class="flex jc_sb fs24 pdt14">
79 <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view> 79 <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view>
80 - <view class="gray">分成金额: 80 + <view class="gray" wx:if="{{is_distribut}}">分成金额:
81 <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text> 81 <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text>
82 <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text> 82 <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text>
83 </view> 83 </view>
packageA/pages/my_service/appment_main.js
@@ -113,7 +113,9 @@ Page({ @@ -113,7 +113,9 @@ Page({
113 "storageId": storageId, 113 "storageId": storageId,
114 "storeId": storeId, 114 "storeId": storeId,
115 "userId": userId, 115 "userId": userId,
116 - "validay": validay 116 + "validay": validay,
  117 + "isxz": 1
  118 +
117 } 119 }
118 var data = JSON.stringify(json); 120 var data = JSON.stringify(json);
119 wx.request({ 121 wx.request({
@@ -130,47 +132,47 @@ Page({ @@ -130,47 +132,47 @@ Page({
130 wx.hideLoading(); 132 wx.hideLoading();
131 if (res.data.code == 0) { 133 if (res.data.code == 0) {
132 getApp().my_warnning("预约成功", 1, th); 134 getApp().my_warnning("预约成功", 1, th);
133 - var store_name = th.data.store_name; //预约门店 135 + // var store_name = th.data.store_name; //预约门店
134 var number = res.data.data.Number; 136 var number = res.data.data.Number;
135 - var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口  
136 - var userinfo = getApp().globalData.userInfo;  
137 - var name = d.userInfo.nickname;  
138 - var json = {  
139 - // "formId": formid,  
140 - "keyWord": [{  
141 - "keyword": res.data.data.ServiceName  
142 - },  
143 - {  
144 - "keyword": time.substring(0, 16)  
145 - }, {  
146 - "keyword": res.data.data.BeauticianName  
147 - }, {  
148 - "keyword": res.data.data.StorageName  
149 - }, {  
150 - "keyword": res.data.data.Address  
151 - }  
152 - ],  
153 - "page": "/packageA/pages/my_service/tment_details?number=" + number,  
154 - "storeId": a.stoid,  
155 - "typeId": "1011",  
156 - "userId": th.data.options.userid  
157 - };  
158 - var data = JSON.stringify(json);  
159 - //调用发送预约成功模版接口  
160 - wx.request({  
161 - url: th.data.inurl + temp_url,  
162 - data: data,  
163 - method: 'post',  
164 - header: {  
165 - 'content-type': 'application/json'  
166 - }, // 设置请求的 header  
167 - success: function(data) {}  
168 - })  
169 - setTimeout(function() { 137 + // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
  138 + //var userinfo = getApp().globalData.userInfo;
  139 + //var name = d.userInfo.nickname;
  140 + // var json = {
  141 + // // "formId": formid,
  142 + // "keyWord": [{
  143 + // "keyword": res.data.data.ServiceName
  144 + // },
  145 + // {
  146 + // "keyword": time.substring(0, 16)
  147 + // }, {
  148 + // "keyword": res.data.data.BeauticianName
  149 + // }, {
  150 + // "keyword": res.data.data.StorageName
  151 + // }, {
  152 + // "keyword": res.data.data.Address
  153 + // }
  154 + // ],
  155 + // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
  156 + // "storeId": a.stoid,
  157 + // "typeId": "1011",
  158 + // "userId": th.data.options.userid
  159 + // };
  160 + // var data = JSON.stringify(json);
  161 + // //调用发送预约成功模版接口
  162 + // wx.request({
  163 + // url: th.data.inurl + temp_url,
  164 + // data: data,
  165 + // method: 'post',
  166 + // header: {
  167 + // 'content-type': 'application/json'
  168 + // }, // 设置请求的 header
  169 + // success: function(data) {}
  170 + // })
  171 +
170 wx.redirectTo({ 172 wx.redirectTo({
171 - url: "/packageA/pages/my_service/tment_details?number=" + number 173 + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
172 }); 174 });
173 - }, 1000); 175 +
174 } else { 176 } else {
175 getApp().my_warnning(res.data.msg, 0, th); 177 getApp().my_warnning(res.data.msg, 0, th);
176 th.settime(); 178 th.settime();
@@ -237,40 +239,42 @@ Page({ @@ -237,40 +239,42 @@ Page({
237 wx.showLoading({ 239 wx.showLoading({
238 title: '加载中', 240 title: '加载中',
239 }) 241 })
240 - if (th.ver(version, '7.0.4') >= 0) {  
241 - //获取模版id  
242 - getApp().request.promiseGet(temp_url, {  
243 - data: {  
244 - store_id: a.stoid,  
245 - typeid: "1011"  
246 - }  
247 - }).then(res => {  
248 - if (res.data.code == 0 && res.data.data.pageData.length > 0) {  
249 - template_id = res.data.data.pageData[0].template_id;  
250 - // //授权订阅  
251 - wx.requestSubscribeMessage({  
252 - tmplIds: [template_id],  
253 - success(res) {  
254 - th.success();  
255 - },  
256 - fail(res) {  
257 - th.success();  
258 - }  
259 - })  
260 - } else {  
261 - th.success();  
262 - }  
263 - })  
264 - } else {  
265 - // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示  
266 - wx.showModal({  
267 - title: '提示',  
268 - content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'  
269 - })  
270 - th.setData({  
271 - is_sub: 0  
272 - })  
273 - } 242 +
  243 + th.success();
  244 + // if (th.ver(version, '7.0.4') >= 0) {
  245 + // //获取模版id
  246 + // getApp().request.promiseGet(temp_url, {
  247 + // data: {
  248 + // store_id: a.stoid,
  249 + // typeid: "1011"
  250 + // }
  251 + // }).then(res => {
  252 + // if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  253 + // template_id = res.data.data.pageData[0].template_id;
  254 + // // //授权订阅
  255 + // wx.requestSubscribeMessage({
  256 + // tmplIds: [template_id],
  257 + // success(res) {
  258 + // th.success();
  259 + // },
  260 + // fail(res) {
  261 + // th.success();
  262 + // }
  263 + // })
  264 + // } else {
  265 + // th.success();
  266 + // }
  267 + // })
  268 + // } else {
  269 + // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
  270 + // wx.showModal({
  271 + // title: '提示',
  272 + // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  273 + // })
  274 + // th.setData({
  275 + // is_sub: 0
  276 + // })
  277 + // }
274 278
275 } 279 }
276 }, 280 },
@@ -579,14 +583,16 @@ Page({ @@ -579,14 +583,16 @@ Page({
579 UserCode: th.data.options.usercode, 583 UserCode: th.data.options.usercode,
580 } 584 }
581 }).then(res => { 585 }).then(res => {
582 - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode); 586 + console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
583 if(res.data.data.Tech) { 587 if(res.data.data.Tech) {
584 - th.setData({ 588 +
  589 + var data={
585 store_name: res.data.data.StorageName, 590 store_name: res.data.data.StorageName,
586 beautician_name: res.data.data.StaffName, 591 beautician_name: res.data.data.StaffName,
587 beauticianID: res.data.data.StaffId, 592 beauticianID: res.data.data.StaffId,
588 StorageId: res.data.data.StorageId, 593 StorageId: res.data.data.StorageId,
589 - }); 594 + }
  595 + th.check_firleader(data);
590 } 596 }
591 }); 597 });
592 598
@@ -670,4 +676,75 @@ Page({ @@ -670,4 +676,75 @@ Page({
670 // var nav_b = th.selectComponent("#nav_b"); //组件的id 676 // var nav_b = th.selectComponent("#nav_b"); //组件的id
671 // nav_b.close_box(); 677 // nav_b.close_box();
672 // } 678 // }
  679 +
  680 + //判断分享的导购是不是有门店,是不是该门店下又该会员
  681 + check_firleader(data){
  682 + var th=this;
  683 + var itemId = this.data.itemId; //服务id
  684 + var url = "/api/weshop/marketing/reservation/storage/pagenew";
  685 + var key_word = data.store_name;
  686 + key_word = key_word.replace(/\s+/g, "");
  687 + getApp().request.promiseGet(url, {
  688 + data: {
  689 + userId: th.data.options.userid,
  690 + storeId: os.stoid,
  691 + serviceId: itemId,
  692 + latitude: th.data.lat,
  693 + longitude: th.data.lon,
  694 + page: 1,
  695 + pageSize: 1000,
  696 + keyWord: key_word
  697 + }
  698 + }).then(res => {
  699 + //-- 如果是门店的话 --
  700 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  701 + var store_data=null;
  702 + for(var i in res.data.data.pageData){
  703 + var it=res.data.data.pageData[i];
  704 + if(it.Id==data.StorageId){
  705 + store_data={
  706 + store_name: data.store_name,
  707 + StorageId: data.StorageId,
  708 + };
  709 + break;
  710 + }
  711 + }
  712 + if(!store_data) return false;
  713 + th.setData(store_data)
  714 +
  715 + }else{
  716 + return false;
  717 + }
  718 +
  719 + //导购接口地址
  720 + var url = "/api/weshop/marketing/reservation/staff/pagenew";
  721 + return getApp().request.promiseGet(url, {
  722 + isShowLoading:1,
  723 + data: {
  724 + storeId: os.stoid,
  725 + userId: th.data.options.userid,
  726 + serviceId: itemId,
  727 + storageId: data.StorageId
  728 + }
  729 + })
  730 + }).then(res=>{
  731 + if (res && res.data && res.data.code == 0) {
  732 + var beautician_list=res.data.data;
  733 + for(var i in beautician_list){
  734 + var item=beautician_list[i];
  735 + if(item.staffid==data.beauticianID){
  736 + th.setData({
  737 + beautician_name:data.beautician_name,
  738 + beauticianID:data.beauticianID,
  739 + })
  740 + break;
  741 + }
  742 + }
  743 +
  744 + }
  745 + })
  746 + }
  747 +
  748 +
  749 +
673 }) 750 })
674 \ No newline at end of file 751 \ No newline at end of file
packageA/pages/my_service/beauty_deta.js
@@ -163,9 +163,10 @@ Page({ @@ -163,9 +163,10 @@ Page({
163 var json = { 163 var json = {
164 "arrangeTime": time, 164 "arrangeTime": time,
165 "number": th.data.number, 165 "number": th.data.number,
166 - "remark": "更改时间", 166 + "remark": "更改预约时间",
167 "states": 0, 167 "states": 0,
168 "storeId": a.stoid, 168 "storeId": a.stoid,
  169 + "isxz": 1
169 }; 170 };
170 var data = JSON.stringify(json); 171 var data = JSON.stringify(json);
171 var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 172 var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址
@@ -369,6 +370,7 @@ Page({ @@ -369,6 +370,7 @@ Page({
369 "remark": "更改预约时间", 370 "remark": "更改预约时间",
370 "states": 0, 371 "states": 0,
371 "storeId": a.stoid, 372 "storeId": a.stoid,
  373 + "isxz": 1
372 }; 374 };
373 var data = JSON.stringify(json); 375 var data = JSON.stringify(json);
374 var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 376 var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址
packageA/pages/my_service/i_service.wxml
@@ -86,8 +86,8 @@ @@ -86,8 +86,8 @@
86 <view class="flex-level"> 86 <view class="flex-level">
87 <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image> 87 <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image>
88 </view> 88 </view>
89 - <!-- <view class="flex-level fs30 xc-ash">暂无服务项目</view> -->  
90 - <view class="flex-level fs30 xc-ash">暂无服务卡项,<text class="ctb" data-url="/packageA/pages/cardList/cardList" bindtap="goto">立即购买!</text></view> 89 + <view class="flex-level fs30 xc-ash">暂无服务项目</view>
  90 + <!-- <view class="flex-level fs30 xc-ash">暂无服务卡项,<text class="ctb" data-url="/packageA/pages/cardList/cardList" bindtap="goto">立即购买!</text></view> -->
91 <view class="flex-level"> 91 <view class="flex-level">
92 <navigator data-url="/pages/user/index/index" bindtap="goto"> 92 <navigator data-url="/pages/user/index/index" bindtap="goto">
93 <view class="flex-center fs28 white">回到首页</view> 93 <view class="flex-center fs28 white">回到首页</view>
packageA/pages/my_service/tment_details.js
@@ -36,7 +36,8 @@ Page({ @@ -36,7 +36,8 @@ Page({
36 var json = { 36 var json = {
37 "number": number, 37 "number": number,
38 "storeId": a.stoid, 38 "storeId": a.stoid,
39 - "states": states 39 + "states": states,
  40 + "isxz": 1
40 }; 41 };
41 var data = JSON.stringify(json); 42 var data = JSON.stringify(json);
42 var url = th.data.url + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 43 var url = th.data.url + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址
@@ -69,6 +70,10 @@ Page({ @@ -69,6 +70,10 @@ Page({
69 * 生命周期函数--监听页面加载 70 * 生命周期函数--监听页面加载
70 */ 71 */
71 onLoad: function(options) { 72 onLoad: function(options) {
  73 +
  74 + console.log("预约详情");
  75 + console.log(options);
  76 +
72 var th = this; 77 var th = this;
73 th.setData({ 78 th.setData({
74 options, 79 options,
packageA/pages/parseHtml/parseHtml.js 0 → 100644
  1 +var WxParse = require('../../../utils/wxParse/wxParse.js');
  2 +
  3 +const app = getApp();
  4 +let self = null;
  5 +let content_privacy = `<div>
  6 + <p class="tac font16"><b>隐私政策</b><br /><br /></p>
  7 + <p>美得得(以下或称“我们”)将按法律法规要求,采取相应安全报货措施,尽力保护您的个人信息安全可控。有鉴于此,我们制定本《隐私政策》(下称“本政策”)并提醒你: </p>
  8 + <p>本政策适用于美得得产品及服务。如我们关联公司的产品或服务中使用了美得得提供的产品或服务但未设独立的隐私政策的,则本政策同样适用于该部分产品或服务。 </p>
  9 + <p>需要特别说明的是,<strong><u>本隐私政策不适用于其他第三方通过前述网页或客户端或者小程序或公众号等向您提供服务。例如您通过美得得使用第三方应用或者服务,或第三方服务和产品依托美得得产品向您提供服务时,您向第三方提供的信息不适用本政策。</u></strong><strong><u> </u></strong></p>
  10 + <p>在使用美得得产品或服务前,请您务必仔细查阅并透彻理解本政策,再确认充分理解并同意后使用相关产品或服务,如您对本隐私政策有任何疑问,您可以通过我们公布的联系方式与我们联系。<strong><u>一旦您开始使用美得得产品或服务,即表示您已同意我们按照本隐私政策来收集、处理、存储、使用、共享和保护您的个人信息。</u></strong><strong><u> </u></strong></p>
  11 + <p>第一部分定义</p>
  12 + <p>个人信息:指以电子或者其他方式记录的能够单独或者与其他信息结合识别特定自然人身份或者反映特定自然人活动情况的各种信息。</p>
  13 + <p>个人敏感信息:包括身份证件号码、手机号码、个人生物识别信息、银行账号、财产信息、行踪轨迹、交易信息、14岁以下(含)儿童的个人信息等。</p>
  14 + <p>个人信息删除:指在实现日常业务功能所涉及的系统中去除个人信息的行为,使其保持不可被检索、访问的状态。</p>
  15 + <p>第二部分 隐私政策 <br />
  16 + 1、我们如何收集和使用您的个人信息; <br />
  17 + 2、我们如何使用 Cookie 和同类技术; <br />
  18 + 3、我们如何共享、转让、公开披露您的个人信息; <br />
  19 + 4、我们如何保护您的个人信息; <br />
  20 + 5、您如何行使您的个人信息权利; <br />
  21 + 6、我们如何处理儿童的个人信息; <br />
  22 + 7、您的个人信息如何在全球范围转移; <br />
  23 + 8、本政策如何更新; <br />
  24 + 9、如何联系我们。 </p>
  25 + <p>一、我们如何收集和使用您的个人信息 <br />
  26 + 我们会出于本政策所述的以下目的,收集和使用您的个人信息: </p>
  27 + <p>(一)提供账号服务 <br />
  28 + 为了遵守法律法规的要求,以及向您提供更个性化、更便捷的服务,我们需要识别您的身份,<strong><u>当您注册我们的账户及您在使用我们的相关服务时,需要您授权您的微信或微博等第三方账号的ID及头像和昵称,您需要填写、提交及/或以其他任何方式提供您的个人信息,包括但不限于您的姓名、性别、出生年月日、身份证号码、电话号码、电子邮箱、收货地址及相关附加信息(如您地址中的所在省份和城市、邮政编码等)、银行账户或其他支付工具的账户信息等。</u></strong>如果您仅需使用浏览、搜索等基本服务,您不需要注册成为我们的账号及提供上述信息。如您不提供真实姓名、性别、出生年月日、身份证号码、电话号码、电子邮箱也不影响您使用美得得的服务进行基本浏览、搜索、购买功能等服务。 </p>
  29 + <p>(二)为您展示或推送商品或服务 <br />
  30 + <strong><u>为给您提供更好的交易服务,我们会根据您的浏览及搜索记录、设备信息、位置信息、订单信息、及可能的个人身份信息,提取您的浏览、搜索偏好、行为习惯、位置信息等特征,基于特征标签进行间接人群画像并展示、推送信息。</u></strong>如您不想接受我们给您发送的商业广告,您可通过短信提示回复退订或我们提供的其他方式进行退订。 </p>
  31 + <p>(三)向您提供商品或服务 <br />
  32 + <strong><u>1、您向我们提供的信息</u></strong><strong><u> </u></strong><br />
  33 + <strong><u>为便于向您提供我们的产品或服务,我们会记录您提供的收货人姓名、收货地址、邮政编码、收货人联系电话。为完成交易,我们将搜集您的支付信息,以便我们了解您的支付状态。</u></strong><strong><u> </u></strong><br />
  34 +
  35 + 您可以通过美得得为其他人订购商品或服务或要求其他人帮您付款,您需要提供该实际订购人的前述个人信息或提供代付人的支付信息或手机号码。向美得得提供这些个人信息之前,您需确保您已经取得其授权同意。 <br />
  36 + <strong>2、我们在您使用服务过程中收集的信息</strong><strong> </strong><br />
  37 +
  38 + 为向您提供更契合您需求的页面展示和搜索结果、了解产品适配性、识别账户异常状态,我们会收集关于您使用的服务以及使用方式的信息并将这些信息进行关联,这些信息包括: <br />
  39 +
  40 + 设备信息:我们会根据您在软件安装及使用中授予的具体权限,接收并记录您所使用的设备相关信息(例如设备型号、操作系统版本等软硬件特征和设备环境信息)、设备所在位置相关信息(例如IP 地址、GPS位置以及能够提供相关信息的Wi-Fi 接入点、蓝牙和基站等传感器信息)。 <br />
  41 +
  42 + 日志信息:当您使用我们的网站或客户端提供的产品或服务时,我们会自动收集您对我们服务的详细使用情况,作为有关网络日志保存。例如您的IP地址、浏览器的类型、电信运营商、使用的语言、访问日期和时间及您访问的网页记录等。 <br />
  43 + <strong><u>请注意,单独的设备信息、日志信息等是无法识别特定自然人身份的信息。</u></strong>如果我们将这类非个人信息与其他信息结合用于识别特定自然人身份,或者将其与个人信息结合使用,则在结合使用期间,这类非个人信息将被视为个人信息,除取得您授权或法律法规另有规定外,我们会将该类个人信息做匿名化、去标识化处理。 <br />
  44 + 为展示您账户的订单信息,我们会收集您在使用我们服务过程中产生的订单信息用于向您展示及便于您对订单进行管理。 <br />
  45 + <strong><u>当您与我们联系时,我们可能会保存您的通信/通话记录和内容或您留下的联系方式等信息,以便与您联系或帮助您解决问题,或记录相关问题的处理方案及结果。</u></strong><strong><u> </u></strong><br />
  46 + <strong>3、我们通过间接获得方式收集到的您的个人信息</strong><strong> </strong><br />
  47 + 为确认交易状态及为您提供售后与争议解决服务,我们会通过您基于交易所选择的交易对象、交易方式、支付机构、物流公司等收集与交易进度相关的您的交易、支付、物流信息,或将您的交易信息共享给上述服务提供者。 <br />
  48 + 您可通过我们提供的链接入口使用美得得账户登录我们关联公司或者合作公司提供的产品或服务,包括来自微信、微博、快手、小程序等的信息。 <br />
  49 + <strong><u>您在使用第三方服务时,可以直接使用第三方服务时直接跳转到我们提供服务的页面,如您进行了除浏览以外的行为,我们将可能收集到您的个人信息(包括您在第三账号的ID、头像、昵称等)。</u></strong><strong><u> </u></strong></p>
  50 + <p>(四)为您提供安全保障 <br />
  51 + 为提高您使用我们及我们关联公司、合作伙伴提供服务的安全性,保护您或其他用户或公众的人身财产安全免遭侵害,<strong><u>我们可能使用或整合您的个人信息、交易信息、设备信息、有关网络日志以及我们关联公司、合作伙伴取得您授权或依据法律共享的信息,来综合判断您账户及交易风险、进行身份验证、检测及防范安全事件,并依法采取必要的记录、审计、分析、处置措施。</u></strong><strong><u> </u></strong></p>
  52 + <p>(五)其他用途 <br />
  53 + 我们将信息用于本政策未载明的其他用途,或者将基于特定目的收集而来的信息用于其他目的时,会事先征求您的同意。 <br />
  54 + (六)征得授权同意的例外 <br />
  55 + 根据相关法律法规规定,以下情形中收集您的个人信息无需征得您的授权同意: <br />
  56 + 1、根据法律法规的规定或行政、司法机构等有权机关的要求或者授权; <br />
  57 + 2、您出现违反适用法律、法规规定或者违反您与我们签署的相关协议(包括在线签署的电子协议)或相关规则时需要向第三方披露的情形。 <br />
  58 + 3、我们与第三方进行联合营销活动,我们可能与其共享活动过程中产生的、为完成活动所必要的个人信息,如参加活动的用户数、中奖名单、中奖人联系方式等,以便第三方能及时向您发放奖品。如与授权合作伙伴共享,仅为实现本政策中声明的目的,我们的某些服务将由授权合作伙伴提供。我们可能会与合作伙伴共享您的某些个人信息,以提供更好的客户服务和用户体验。例如,在您使用我们配送服务时,我们必须与物流服务提供商共享您的个人信息才能安排送货,或者安排合作伙伴提供服务。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,并且只会共享提供服务所必要的个人信息。我们的合作伙伴无权将共享的个人信息用于任何其他用途; <br />
  59 + 4、为维护我们及关联方或其他我们用户的合法权益; <br />
  60 + 5、从合法公开披露的信息中收集个人信息的,如合法的新闻报道、政府信息公开等渠道; <br />
  61 + 6、出于实现本政策公示的我们如何使用您的个人信息的目的,或为履行我们和您签订的协议中或本隐私政策中的义务和行使我们的权利,向我们的关联方、合作伙伴或代表我们履行某项职能的第三方(例如处理银行卡的支付机构等)分享您的个人信息。; <br />
  62 + 7、法律法规规定的其他情形。 <br />
  63 + 如我们停止运营美得得产品或服务,我们将及时停止继续收集您个人信息的活动,将停止运营的通知以逐一送达或公告的形式通知您,对所持有的个人信息进行删除或匿名化处理。 </p>
  64 + <p>二、我们如何使用 Cookie 和同类技术 <br />
  65 + (一)Cookie的使用 <br />
  66 + 为确保网站正常运转、为您获得更轻松的访问体验、向您推荐您可能感兴趣的内容,我们会在您的计算机或移动设备上存储名Cookie、Flash Cookie或浏览器或关联应用程序提供的其他通常包含标识符、站点名称以及一些号码和字符的本地存储(统称“Cookie”)。借助于 Cookie,网站能够存储您的偏好或购物车内的商品等数据。 <br />
  67 + 如果您的浏览器或浏览器附加服务允许,您可修改对Cookie的接受程度或拒绝我们的Cookie。但如果您这么做,在某些情况下可能会影响您安全访问我们的网站,而无法使用部分我们提供的服务。 <br />
  68 + (二)网站信标和像素标签 <br />
  69 + 除Cookie 外,我们还会在网站上使用网站信标和像素标签等其他同类技术。例如,我们向您发送的电子邮件可能含有链接至我们网站内容的地址链接,如果您点击该链接,我们则会跟踪此次点击,帮助我们了解您的产品或服务偏好以便于我们主动改善客户服务体验。网站信标通常是一种嵌入到网站或电子邮件中的透明图像。借助于电子邮件中的像素标签,我们能够获知电子邮件是否被打开。如果您不希望自己的活动以这种方式被追踪,则可以随时从我们的寄信名单中退订。 </p>
  70 + <p>三、我们如何共享、转让、公开披露您的个人信息 <br />
  71 + (一)共享 <br />
  72 + 我们不会与美得得服务提供者以外的公司、组织和个人共享您的个人信息,但以下情况除外: <br />
  73 + 1、在您主动选择情况下共享:若您主动通过美得得购买商品和服务,我们会根据您的选择,将您的订单信息与交易有关的必要信息与相关商品和服务的提供者共享来实现您向其购买商品或服务的需求,并促使其可以完成后续的售后服务。您可以在相关商品和服务的提供者从事经营活动的主页面查询其营业执照登载的信息,以辨别您的交易对象身份。 <br />
  74 + 2、在获取明确同意情况下共享:获得您的明确同意后,我们会与其他方共享您的个人信息。例如,如果我们委托第三方向您提供产品或服务时,我们会在征得您同意后将上述信息共享给第三方,如果您拒绝提供此类信息,我们将无法完成相关交付服务。 <br />
  75 + 3、在法定情形下共享:我们可能会根据法律法规规定、诉讼争议解决需要,或按行政、司法机关依法提出的要求,对外共享您的个人信息。 <br />
  76 + 4、与关联公司共享:<strong><u>为便于我们基于</u></strong><strong><u>美得得</u></strong><strong><u>账户向您提供服务,推荐您可能感兴趣的信息或保护</u></strong><strong><u>美得得</u></strong><strong><u>关联公司或其他用户或公众的人身财产安全免遭侵害,您的个人信息可能会与我们的关联公司共享。</u></strong>我们只会共享必要的个人信息,且受本隐私政策中所声明目的的约束,如果我们共享您的个人敏感信息或关联公司改变个人信息的使用及处理目的,将再次征求您的授权同意。 <br />
  77 + 5、与授权合作伙伴共享:我们会委托授权合作伙伴为您提供某些服务或代表我们履行职能,我们仅会出于合法、正当、必要、特定、明确的目的共享您的信息,授权合作伙伴只能接触到为其履行职责所需信息,且不能将此信息用于任何其他目的。 <br />
  78 + 目前,我们的授权合作伙伴包括以下类型: <br />
  79 + (1)<strong><u>使用我们SaaS软件的商家,使用我们的SaaS软件的商家为您商品或服务时,您提交的订单信息、支付信息、收货地址和联系人信息等,我们会使用我们SaaS软件的商家提供,以便于他们能完成您所需要的服务。如您不使用他们的服务,我们不会主动给任何一个商家提供您的任何个人信息。</u></strong><strong><u> </u></strong><br />
  80 + (2)广告、分析服务类的授权合作伙伴。除非得到您的许可,否则我们不会将您的个人身份信息(指可以识别您身份的信息,例如姓名或电子邮箱,通过这些信息可以联系到您或识别您的身份)与提供广告、分析服务的合作伙伴共享。 <br />
  81 + (3)供应商、服务提供商和其他合作伙伴。我们将信息发送给支持我们业务的供应商、服务提供商和其他合作伙伴,这些支持包括提供技术基础设施服务、分析我们服务的使用方式、衡量服务的有效性、提供客户服务、支付便利或进行学术研究和调查。 <br />
  82 +
  83 + <strong><u> 对我们与之共享个人信息的公司、组织和个人,我们会与其签署严格的数据保护协议,要求他们按照我们的说明、本隐私政策以及其他任何相关的保密和安全措施来处理个人信息。</u></strong><strong><u> </u></strong><br />
  84 + (二)转让 <br />
  85 + 我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外: <br />
  86 + 1、在获取明确同意的情况下转让:获得您的明确同意后,我们会向其他方转让您的个人信息。 <br />
  87 + 2、在美得得服务提供者发生合并、收购或破产清算情形,或其他涉及合并、收购或破产清算情形时,如涉及到个人信息转让,我们会要求新的持有您个人信息的公司、组织继续受本政策的约束,否则我们将要求该公司、组织和个人重新向您征求授权同意。 <br />
  88 + (三)公开披露 <br />
  89 + 我们仅会在以下情况下,公开披露您的个人信息: <br />
  90 + 1、获得您明确同意或基于您的主动选择,我们可能会公开披露您的个人信息; <br />
  91 + 2、<strong><u>如果我们确定您出现违反法律法规或严重违反</u></strong><strong><u>美得得</u></strong><strong><u>相关协议规则的情况,或为保护</u></strong><strong><u>美得得</u></strong><strong><u>及其关联公司用户或公众的人身财产安全免遭侵害,我们可能依据法律法规或</u></strong><strong><u>美得得</u></strong><strong><u>相关协议规则征得您同意的情况下披露关于您的个人信息,包括相关违规行为以及</u></strong><strong><u>美得得</u></strong><strong><u>已对您采取的措施。</u></strong>例如,若您销售假货而严重违反美得得规则,我们可能会公开披露您的店铺主体信息与处罚情况。 <br />
  92 + (四)共享、转让、公开披露个人信息时事先征得授权同意的例外 <br />
  93 + 以下情形中,共享、转让、公开披露您的个人信息无需事先征得您的授权同意: <br />
  94 + 1、根据法律法规的规定或行政、司法机构、国家部门等有权机关的要求依法提供的; <br />
  95 + 2、出于维护您或其他个人的生命、财产等重大合法权益但又很难得到本人同意的; <br />
  96 + 3、您自行向社会公众公开的个人信息; <br />
  97 + 4、从合法公开披露的信息中收集个人信息的,如合法的新闻报道、政府信息公开等渠道。 <br />
  98 + 根据法律规定,共享、转让经去标识化处理的个人信息,且确保数据接收方无法复原并重新识别个人信息主体的,不属于个人信息的对外共享、转让及公开披露行为,对此类数据的保存及处理将无需另行向您通知并征得您的同意。 </p>
  99 + <p>四、我们如何保护您的个人信息安全 <br />
  100 + (一)为保障您的信息安全,我们努力采取各种符合业界标准的物理、电子和管理方面的安全措施来保护您的个人信息,防止您的个人信息遭到未经授权访问、公开披露、使用、修改、损坏或丢失。我们会采取一切合理可行的措施,保护您的个人信息。例如在您的浏览器与“服务”之间交换数据(如信用卡信息)时采用 SSL 加密保护技术;同时对网站本身提供 https 安全浏览方式;使用加密技术确保数据的保密性;使用受信赖的保护机制防止数据遭到恶意攻击;部署访问控制机制,确保只有授权人员才可访问个人信息;以及举办安全和隐私保护培训课程,加强员工对于保护个人信息重要性的认识。。 <br />
  101 + (二)我们的安全系统,有专门的团队在负责,公司从人力财力上均有较大的投入,且我们的系统安全性已通过权威第三方的监测,并获得了ISO27001等认证。 <br />
  102 + (三)我们会采取合理可行的措施,尽力避免收集无关的个人信息。<strong><u>我们只会在达成本政策所述目的所需的期限内保留您的个人信息,除非需要延长保留期或受到法律的允许。</u></strong> <br />
  103 + (四)互联网并非绝对安全的环境,我们强烈建议您通过安全方式、使用复杂密码,协助我们保证您的账号安全。 <br />
  104 + (五)在不幸发生个人信息安全事件后,我们将按照法律法规的要求向您告知:安全事件的基本情况和可能的影响、我们已采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施等。事件相关情况我们将以邮件、信函、电话、推送通知等方式告知您,难以逐一告知个人信息主体时,我们会采取合理、有效的方式发布公告。 <br />
  105 + 同时,我们还将按照监管部门要求,上报个人信息安全事件的处置情况。 </p>
  106 + <p>五、您如何行使您的个人信息权利 <br />
  107 + 您对您的个人信息您享有以下权利: <br />
  108 + (一)您有权访问您的个人信息,法律法规规定的例外情况除外。如果您想行使数据访问权,可以通过以下方式自行访问: <br />
  109 + 账户信息——如果您希望访问或编辑您的账户中的个人资料信息和支付信息、更改您的密码、添加安全信息或关闭您的账户等,您可以通过访问美得得网页执行此类操作。 <br />
  110 + 搜索信息——您可以在美得得网及相关网站中访问或清除您的搜索历史记录、查看和修改兴趣以及管理其他数据。 <br />
  111 + 如果您无法通过上述链接访问这些个人信息,您可以随时联系我们的客服。我们将在30天内回复您的访问请求。 <br />
  112 + (二)您有权更正您的个人信息; <br />
  113 + (三)<strong><u>您有权删除您的个人信息,您可以登录</u></strong><strong><u>美得得</u></strong><strong><u>账号,点击您需要注销账号,再您确认删除您的账号信息时,我们将删除您的信息,由此产生的您的权益或者资产同时消失的损失由您承担;</u></strong><strong><u> </u></strong><br />
  114 + (四)您有权改变您授权同意的范围。 <br />
  115 + 以上信息您均可以通过美得得网站主页进行访问和更新。 <br />
  116 + 如果您认为美得得存在违反法律的规定收集、使用您个人信息的情形,您可以通过美得得客服与我们取得联系。 </p>
  117 + <p>六、您的个人信息如何在全球范围转移 <br />
  118 + 我们在中华人民共和国境内运营中收集和产生的个人信息,存储在中国境内,以下情形除外: <br />
  119 + 1、法律法规有明确规定; <br />
  120 + 2、获得您的明确授权; <br />
  121 + 3、您通过互联网进行跨境交易等个人主动行为。 <br />
  122 + 针对以上情形,我们会确保依据本隐私政策对您的个人信息提供足够的保护。 </p>
  123 + <p>七、我们如何处理儿童的个人信息 <br />
  124 + <strong><u>本政策所指的儿童是指不满14周岁的个人,如果没有父母或监护人的同意,儿童不得创建自己的用户账户。如您为未成年人的,建议您请您的父母或监护人仔细阅读本隐私政策,并在征得您的父母或监护人同意的前提下使用我们的服务或向我们提供信息。对于经父母或监护人同意使用我们的产品或服务而收集未成年人个人信息的情况,我们只会在法律法规允许、父母或监护人明确同意或者保护未成年人所必要的情况下使用、共享、转让或披露此信息。</u></strong>如果我们发现自己在未事先获得可证实的父母同意的情况下收集了儿童的个人信息,则会设法尽快删除相关数据。 </p>
  125 + <p>八、本隐私政策如何更新 <br />
  126 + <strong><u>我们提供的服务和产品会不时更新和调整,隐私政策也将随之可能变更,如发生变更我们会以公示的方式进行通知到您,也不排除使用“弹框”或者邮件、短信等方式通知到您,请您及时查看最新的隐私政策。</u></strong><strong><u> </u></strong></p>
  127 + <p>九、如何联系我们 <br />
  128 + 我们设立了个人信息保护部门,如对本政策内容有任何疑问、意见或建议,或发现您的个人信息可能被泄露,您可以电话到400-087-9077与我们联系,我们将在15天内回复您的请求 <br />
  129 + 如果您对我们的回复不满意,特别是您认为我们的个人信息处理行为损害了您的合法权益,您还可以通过被告住所地有管辖权的法院提起诉讼来寻求解决方案。 </p>
  130 +
  131 + </div>`;
  132 +let content_use = `<div>
  133 + <p class="tac font16"><b>用户协议</b><br /></p>
  134 + <b><p>特别提示:<br />您在使用美得得科技(深圳)有限公司(以下简称“美得得”)及关联公司提供的各项服务之前,请您务必审慎阅读、充分理解本协议各条款内容,特别是以粗体标注的部分,包括但不限于免除或者限制责任的条款。如您不同意本服务协议及/或随时对其的修改,您应立即停止注册;您一旦使用美得得提供的服务,即视为您已了解并完全同意本服务协议各项内容,包括美得得对服务协议所做的修改,并成为我们的用户。<br /></p></b>
  135 + <p><b>一、账号注册</b><br />1、您应当同意本协议的条款并按照页面上的提示完成全部的注册程序。您在进行注册程序或第三方授权登录程序过程中勾选协议即表示您与美得得达成协议,完全接受本协议项下的全部条款约束。</p>
  136 + <p>2、当您选择通过第三方授权登录程序进入美得得,您需授权美得得收集您的账号昵称及头像等标识化的个人信息,授权完成后,您即成为美得得的“用户”。<br />
  137 +
  138 + 当您按照注册页面提示填写信息并注册成功后,您即成为美得得的“用户”;美得得将给予您一个用户帐号,密码由您自行设置。该用户帐号和密码由您自行负责保管。</p>
  139 + <p> 您应当对您在美得得进行的活动和事件负法律责任。</p>
  140 + <p>3、本协议服务条款和公告可由美得得定时更新,并按照法定流程进行公示。您在使用相关服务时,应关注并遵守其所适用的相关条款。</p>
  141 + <p style="font-weight: bold; text-decoration: underline">4、使用同一身份认证信息、同一手机号或经美得得排查认定多个美得得账户的实际控制人为同一人的,均视为同一用户。</p>
  142 + <p>5、您确认,在您开始使用本服务前,您应当具备中华人民共和国法律规定的与您行为相适应的民事行为能力。<b style=" text-decoration: underline">若您不具备前述与您行为相适应的民事行为能力,则您需要在您监护人的陪同下完成注册,并且您与您的监护人应依照法律规定承担因此而导致的一切后果。</b></p>
  143 + <p>二、注册信息和隐私保护<br />
  144 + 1、您帐号的所有权归美得得,使用权归您。您按注册页面引导填写信息,阅读并同意本协议且完成全部注册程序后,即可获得注册账号并成为用户。<b style=" text-decoration: underline">您应提供及时、详尽及准确的个人资料,并不断更新注册资料,符合及时、详尽准确的要求。所有原始键入的资料将引用为注册资料。如果因注册信息不真实或更新不及时而引发的相关问题,由您自行承担相应的责任。</b></p>
  145 + <p>2、您应当通过真实身份信息认证注册帐号,且您提交的帐号名称、头像、 简介等注册信息中不得出现违法和不良信息,经公司审核,如存在上述情况,美得得将不予注册;同时,在注册后,如发现您以虚假信息骗取帐号名称注册,或其帐号头像、简介等注册信息存在违法和不良信息的,<b style=" text-decoration: underline">美得得有权不经通知单方采取限期改正、暂停使用、注销登记、收回等措施。</b></p>
  146 + <p>3、您帐号包括帐户名称和密码,账户名称作为您有效的身份凭证之一。您可使用手机号和密码登录。</p>
  147 + <p><b style=" text-decoration: underline">4、您不应将其帐号、密码转让、出售或出借予他人使用,若您授权他人使用帐户,应对被授权人在该帐户下发生所有行为负全部责任。</b>由于您其他账户使用信息,仅当依法律法规、司法裁定或经美得得同意,并符合美得得规定的用户帐号转让流程的情况下,方可进行帐号的转让。</p>
  148 + <p>5、因您个人原因导致的帐号信息遗失,如需找回帐号信息,请按照帐号找回要求提供相应的信息,并确保提供的信息合法真实有效,<b style=" text-decoration: underline">若提供的信息不符合要求,无法通过安全验证,美得得有权拒绝提供帐号找回服务;若帐号的唯一凭证不再有效,美得得有权拒绝支持帐号找回。</b>例如手机号二次出售,美得得可拒绝支持帮助找回原手机号绑定的帐号。</p>
  149 + <p>6、在需要终止使用帐号服务时,符合以下条件的,您可以申请注销您的帐号:<br />
  150 + (1)您仅能申请注销您本人的帐号,并依照美得得的流程进行注销;<br />
  151 + (2)您仍应对您在注销帐号前且使用的行为承担相应责任,同时美得得仍可保存您注销前的相关信息;<br />
  152 + (3)注销成功后,帐号信息、个人身份信息、交易记录、会员权益等将无法恢复或提供。<br />
  153 + 7、当您使用美得得产品进行支付、登录等操作的时候,服务器会自动接收、验证、并记录一些必要的信息,如手机号码、IP地址、服务访问异常信息、以及部分设备信息等,以保障您在使用服务时账户登录和支付过程的安全,进而保护您的上网安全。<b style=" text-decoration: underline">您使用美得得的服务,即表示您同意美得得可以按照《隐私政策》处理您的个人信息。</b>美得得可能会与合作伙伴共同向您提供您所要求的服务或者共同向您展示您可能感兴趣的内容。在信息为该项产品/服务所必须的情况下,您同意美得得可与其分享必要的信息。并且,美得得会要求其确保数据安全并且禁止用于任何其他用途。除此之外,美得得不会向任何无关第三方提供或分享信息。</p>
  154 + <p>8、您知悉并授权,美得得仅在必需的情况下使用或与关联公司同步您的信息,以为您提供更好的服务。<br />
  155 + 9、为更好地向您提供服务,您同意美得得通过短信、app通知等形式向您发送相关商业性服务信息。</p>
  156 + <p><b style=" text-decoration: underline">三、使用规则</b><br />
  157 + 1、您在使用美得得的服务时,必须遵守中华人民共和国相关法律法规的规定,您应同意将不会利用本服务进行任何违法或不正当的活动,包括但不限于下列行为:<br />
  158 + (1)您设置的会员名或提供的信息不得含有下列内容之一的信息:<br />
  159 +   
  160 + ① 反对宪法所确定的基本原则的; <br />
  161 +   
  162 + ② 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的; <br />
  163 +   
  164 + ③ 损害国家荣誉和利益的; <br />
  165 +   
  166 + ④ 煽动民族仇恨、民族歧视、破坏民族团结的; <br />
  167 +   
  168 + ⑤ 破坏国家宗教政策,宣扬邪教和封建迷信的; <br />
  169 +   
  170 + ⑥ 散布谣言,扰乱社会秩序,破坏社会稳定的; <br />
  171 +   
  172 + ⑦ 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的; <br />
  173 +   
  174 + ⑧ 侮辱或者诽谤他人,侵害他人合法权利的; <br />
  175 +   
  176 + ⑨ 含有虚假、有害、胁迫、侵害他人隐私、骚扰、侵害、中伤、粗俗、猥亵、或其它道德上令人反感的内容; <br />
  177 +   
  178 + ⑩ 含有中国法律、法规、规章、条例以及任何具有法律效力之规范所限制或禁止的其它内容的; <br />
  179 + (2)不得为任何非法目的而使用美得得服务系统;<br />
  180 + (3)不利用美得得的服务从事以下活动:<br />
  181 +   
  182 + ① 未经允许,进入计算机信息网络或者使用计算机信息网络资源的; <br />
  183 +   
  184 + ② 未经允许,对计算机信息网络功能进行删除、修改或者增加的; <br />
  185 +   
  186 + ③ 未经允许,对进入计算机信息网络中存储、处理或者传输的数据和应用程序进行删除、修改或者增加的; <br />
  187 +   
  188 + ④ 故意制作、传播计算机病毒等破坏性程序的; <br />
  189 +   
  190 + ⑤ 其他危害计算机信息网络安全的行为。 <br />
  191 + <b style=" text-decoration: underline">2、您违反本协议或相关的服务条款的规定,导致或产生的任何第三方主张的任何索赔、要求或损失,包括合理的律师费,您同意赔偿美得得与合作公司、关联公司,并使之免受损害。对此,美得得有权视您的行为性质,采取包括但不限于删除您发布信息内容、暂停使用许可、终止服务、限制使用、回收帐号、追究法律责任等措施。对恶意注册帐号或利用帐号进行违法活动、捣乱、骚扰、欺骗、其他用户以及其他违反本协议的行为,美得得有权回收其帐号。同时,美得得会视司法部门的要求,协助调查。<br />
  192 + 3、您需要对自己在服务使用过程中的行为负法律责任,即使您已经终止使用该服务。您承担法律责任的形式包括但不限于:对受到侵害者进行赔偿,以及在美得得首先承担了因您的行为导致的行政处罚或侵权损害赔偿责任后,您应给予美得得等额的赔偿。<br /></b>
  193 + 4、美得得有权根据认定程序及标准判断您账户的使用可能危及您的账户安全及/或美得得平台信息安全的,美得得可拒绝提供相应服务或终止本协议。<br />
  194 + </p>
  195 + <p><b style=" text-decoration: underline">四、服务内容</b></p>
  196 + <p>1、您在交易过程中与其他用户发生争议的,您或其他用户中任何一方可以自行协商解决,也可以通过美得得介入处理,若您觉得以上的方式均无法达到您要的结果,您可以寻求司法机关的协助。</p>
  197 + <p>2、您选择美得得介入的方式处理相关问题,那么您需要遵守和执行美得得的处理结果。若您对美得得的处理结果不满意,您可以寻求其他途径解决纠纷例如起诉、仲裁等方式,但在此之前您需先履行该结果。</p>
  198 + <p>3、美得得目前为您提供免费提供服务,但美得得保留因业务调整或者其他法律法规要求向您收取费用的权利。</p>
  199 + <p>4、美得得网络服务的具体内容由美得得根据实际情况提供。<br />
  200 + <b style=" text-decoration: underline"> 5、鉴于网络服务的特殊性,您同意美得得有权不经事先通知,随时变更、中断或终止部分或全部的网络服务(包括收费网络服务)。美得得不担保网络服务不会中断,对网络服务的及时性、安全性、准确性也都不作担保。</b></p>
  201 + <b><p>6、您需遵守美得得7天无理由退换货的相关规则。</p>
  202 + <p>7、终止服务<br />
  203 + 您同意美得得得基于其自行之考虑,因任何理由,或美得得认为您已经违反本服务协议的文字及精神,终止您的密码、帐号或本服务之使用(或服务之任何部分),并将您在本服务内任何内容加以移除并删除。您同意依本服务协议任何规定提供之本服务,无需进行事先通知即可中断或终止,您承认并同意,美得得可立即关闭或删除您的帐号及您帐号中所有相关信息及文件,及/或禁止继续使用前述文件或本服务。此外,您同意若本服务之使用被中断或终止或您的帐号及相关信息和文件被关闭或删除,美得得对您或任何第三人均不承担任何责任。</p>
  204 + <p>五、个人数据保护与授权</p></b>
  205 + <p>1、为了保护您的财产及信息安全,预防诈骗或者其他网络犯罪行为,美得得有权收集您的个人信息,包括但不限于个人会员信息、交易信息来判断您个人的交易风险,对您身份进行验证等。</p>
  206 + <b style=" text-decoration: underline"><p>2、根据相关法律法规规定,以下情形中收集您的个人信息无需征得您的授权同意:</p>
  207 + <p>①、涉及公共安全,与重大利益相关的;</p>
  208 + <p>②、与政府部门包括司法机关等相关的;</p>
  209 + <p>③、出于保护您的个人财产或者利益的目的,但无法事先征求您同意的行为;</p>
  210 + <p>④、您以自行对外公开的,包括但不限于通过报纸、新闻等方式公开;</p>
  211 + <p>⑤、根据您的要求签订合同所必需的;</p>
  212 + <p>⑥、用于维护所提供的产品或服务的安全稳定运行所必需的,例如发现、处置产品或服务的故障;</p>
  213 + <p>⑦、国家法律法规政策认可或支持的相关行为;</p></b>
  214 + <p>3、我们已采取符合业界标准、合理可行的安全防护措施保护您提供的个人信息安全,防止个人信息遭到未经授权访问、公开披露、使用、修改、损坏或丢失。<br />
  215 + </p>
  216 + <p><b>六、免责声明</b></p>
  217 + <p>因以下情况造成网络服务在合理时间内的中断,美得得无需为此承担任何责任;<br />
  218 + (1)美得得需要定期或不定期地对提供网络服务的平台或相关的设备进行检修或者维护,美得得保留不经事先通知为维修保养、升级或其它目的暂停本服务任何部分的权利。<br />
  219 + (2)因台风、地震、洪水、雷电或恐怖袭击等不可抗力原因;<br />
  220 + (3)您的电脑软硬件和通信线路、供电线路出现故障的;<br />
  221 + (4)因病毒、木马、恶意程序攻击、网络拥堵、系统不稳定、系统或设备故障、通讯故障、电力故障、银行原因、第三方服务瑕疵或政府行为等原因。<br />
  222 + 尽管有前款约定,美得得将采取合理行动积极促使服务恢复正常。</p>
  223 + <p><b>七、知识产权和其他合法权益</b><br />
  224 + 1、美得得产品及相关网站上由美得得上传、制作、拥有的所有内容,包括但不限于著作、图片、档案、资讯、资料、网站架构、网站画面的安排、网页设计,均由美得得或其关联公司依法拥有其知识产权,包括但不限于商标权、专利权、著作权、商业秘密等。但如因您上传的由其自行制作、拥有的内容涉及侵犯美得得或其他任何第三方的合法权益的,您应自行对其侵权行为产生的纠纷进行处理,并对其侵权行为承担法律责任,且就由此给美得得造成的损失(包括但不限于美得得声誉的影响、美得得由此承担的连带责任(如有)等)进行赔偿。</p>
  225 + <p>2、非经美得得或其关联公司书面同意,任何人不得擅自使用、修改、复制、公开传播、改变、散布、发行或公开发表在本网站上程序或内容(仅限于由美得得上传、制作、拥有的所有内容,包括但不限于著作、图片、档案、资讯、资料、网站架构、网站画面的安排、网页设计等);如您需使用著作权非美得得所有的内容的,您应获得具体内容的著作权所有者的合法授权才能使用,如因您私自使用非自己所有的、且未经他人合法授权的著作、图片、档案、资讯、资料等内容的,由您自行承担责任,包括但不限于您自行对其侵权行为产生的纠纷进行处理,并对其侵权行为承担法律责任,且就由此给乙方造成的损失(包括但不限于乙方声誉的影响、乙方由此承担的连带责任(如有)等)进行赔偿。</p>
  226 + <p>3、尊重知识产权是您应尽的义务,如有违反,您应承担损害赔偿责任。</p>
  227 + <p><b>八、其他</b></p>
  228 + <p>1、本协议之效力、解释、变更、执行与争议解决均适用中华人民共和国法律,没有相关法律规定的,参照通用国际商业惯例和(或)行业惯例。</p>
  229 + <p>2、 如本协议的任何条款被视作无效或无法执行,则上述条款可被分离,其余条款则仍具有法律效力。<br />
  230 + 3、本协议任何一方于另一方过失或违约时放弃本协议规定的权利的,不得视为其对一方的其他或以后同类之过失或违约行为弃权。</p>
  231 + <p>4、美得得未行使或执行本服务协议任何权利或规定,不构成对前述权利或权利之放弃。</p>
  232 + <p>5、杭州美得得科技有限公司和杭州起码科技有限公司是同一实际控制人控制下的两家企业,故本合同项下部分权利义务由杭州起码科技有限公司履行。</p>
  233 + <p>6、本协议最终解释权及修订权在法律范围内归美得得所有。</p>
  234 + </div>`;
  235 +
  236 +Page({
  237 +
  238 + /**
  239 + * 页面的初始数据
  240 + */
  241 + data: {
  242 + list: null,
  243 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  244 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  245 + pageNum: 1, // 当前页数
  246 + },
  247 +
  248 + /**
  249 + * 生命周期函数--监听页面加载
  250 + */
  251 + onLoad: function (options) {
  252 + self = this;
  253 + let title = '';
  254 + let content = '';
  255 + if(options.t == 0) {
  256 + title = '用户使用协议';
  257 + content = content_use;
  258 + } else if(options.t == 1) {
  259 + title = '隐私政策';
  260 + content = content_privacy;
  261 + };
  262 + wx.setNavigationBarTitle({
  263 + title: title,
  264 + });
  265 +
  266 + WxParse.wxParse('content', 'html', content, self);
  267 +
  268 + },
  269 +
  270 + /**
  271 + * 生命周期函数--监听页面初次渲染完成
  272 + */
  273 + onReady: function () {
  274 +
  275 + },
  276 +
  277 + /**
  278 + * 生命周期函数--监听页面显示
  279 + */
  280 + onShow: function () {
  281 +
  282 + },
  283 +
  284 + /**
  285 + * 生命周期函数--监听页面隐藏
  286 + */
  287 + onHide: function () {
  288 +
  289 + },
  290 +
  291 + /**
  292 + * 生命周期函数--监听页面卸载
  293 + */
  294 + onUnload: function () {
  295 +
  296 + },
  297 +
  298 + /**
  299 + * 页面相关事件处理函数--监听用户下拉动作
  300 + */
  301 + onPullDownRefresh: function () {
  302 +
  303 + },
  304 +
  305 + /**
  306 + * 页面上拉触底事件的处理函数
  307 + */
  308 + onReachBottom: function () {
  309 +
  310 + },
  311 +
  312 + /**
  313 + * 用户点击右上角分享
  314 + */
  315 + onShareAppMessage: function () {
  316 +
  317 + },
  318 +
  319 + /**
  320 + * get请求数据
  321 + */
  322 + get(url, data) {
  323 + app.request.get(url + '/' + data.store_id, {
  324 + success: function(res) {
  325 + if(res.data.code == 0){
  326 + console.log('success~~~~~~~~~~~',res);
  327 + self.setData({
  328 + content: res.data.data.distriRule,
  329 + });
  330 + /**
  331 + * WxParse.wxParse(bindName , type, data, target,imagePadding)
  332 + * 1.bindName绑定的数据名(必填)
  333 + * 2.type可以为html或者md(必填)
  334 + * 3.data为传入的具体数据(必填)
  335 + * 4.target为Page对象,一般为this(必填)
  336 + * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
  337 + */
  338 + WxParse.wxParse('content', 'html', self.data.content, self);
  339 + }else{
  340 + wx.showToast({
  341 + title: "网络繁忙,请重试",
  342 + icon: 'none',
  343 + duration: 2000
  344 + })
  345 + }
  346 + },
  347 + fail: function() {},
  348 + });
  349 + },
  350 +
  351 +})
0 \ No newline at end of file 352 \ No newline at end of file
packageA/pages/parseHtml/parseHtml.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "",
  6 + "enablePullDownRefresh": false
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageA/pages/parseHtml/parseHtml.wxml 0 → 100644
  1 +<view class="pd20">
  2 + <!-- <image src="../../../images/cloud.jpg" mode="widthFix" style="width: 100%;"></image> -->
  3 + <view class="fs28 taj">
  4 + <import src="../../../utils/wxParse/wxParse.wxml"/>
  5 + <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
  6 + </view>
  7 +</view>
packageA/pages/parseHtml/parseHtml.wxss 0 → 100644
  1 +/* packageA//pages/distribution/rookie/rookie.wxss */
  2 +.tac {
  3 + text-align: center;
  4 +}
  5 +
  6 +.font16 {
  7 + font-size: 16px;
  8 +}
0 \ No newline at end of file 9 \ No newline at end of file
packageA/pages/profile/profile.js
@@ -6,6 +6,8 @@ function e(e, a, r) { @@ -6,6 +6,8 @@ function e(e, a, r) {
6 writable: !0 6 writable: !0
7 }) : e[a] = r, e; 7 }) : e[a] = r, e;
8 } 8 }
  9 +const app = getApp();
  10 +let self = null;
9 11
10 var a = getApp(), 12 var a = getApp(),
11 r = a.globalData.setting, 13 r = a.globalData.setting,
@@ -17,10 +19,10 @@ var a = getApp(), @@ -17,10 +19,10 @@ var a = getApp(),
17 19
18 var timestamp = Date.parse(new Date()); 20 var timestamp = Date.parse(new Date());
19 var date = new Date(timestamp); 21 var date = new Date(timestamp);
20 -const {  
21 - barcode,  
22 - qrcode  
23 -} = require('../../../utils/index.js'); 22 +// const {
  23 +// barcode,
  24 +// qrcode
  25 +// } = require('../../../utils/index.js');
24 26
25 Page({ 27 Page({
26 data: { 28 data: {
@@ -31,7 +33,7 @@ Page({ @@ -31,7 +33,7 @@ Page({
31 defaultAvatar: r.resourceUrl + "/static/images/user68.jpg", 33 defaultAvatar: r.resourceUrl + "/static/images/user68.jpg",
32 user: null, 34 user: null,
33 tc_hide: true, 35 tc_hide: true,
34 - stoname: "", 36 + stoname: "请选择",
35 checkDate: false, 37 checkDate: false,
36 datet: "", 38 datet: "",
37 year: date.getFullYear(), 39 year: date.getFullYear(),
@@ -54,7 +56,7 @@ Page({ @@ -54,7 +56,7 @@ Page({
54 open_ind_store: 0, //哪里打开的门店列表的控制属性 56 open_ind_store: 0, //哪里打开的门店列表的控制属性
55 ispwhid: 1, //是否隐藏密码显示 57 ispwhid: 1, //是否隐藏密码显示
56 isstcsp: 0, //是否启用密码消费 58 isstcsp: 0, //是否启用密码消费
57 - isGender: 1, //什么性别 59 + isGender: 0, //什么性别
58 iscalendar: 0, //是否是农历 60 iscalendar: 0, //是否是农历
59 consumption: "", //消费密码 61 consumption: "", //消费密码
60 identity_card: "", //身份证值 62 identity_card: "", //身份证值
@@ -68,6 +70,7 @@ Page({ @@ -68,6 +70,7 @@ Page({
68 is_lable_set: "", //是否启用我的兴趣标签 70 is_lable_set: "", //是否启用我的兴趣标签
69 check_label: [], //我选择的兴趣标签 71 check_label: [], //我选择的兴趣标签
70 fir_guide_id:null, //存储会员详情接口出来的美导ID 72 fir_guide_id:null, //存储会员详情接口出来的美导ID
  73 + isLunar: 0,
71 74
72 }, 75 },
73 //通过路径跳转到其他页面 76 //通过路径跳转到其他页面
@@ -75,22 +78,8 @@ Page({ @@ -75,22 +78,8 @@ Page({
75 var url = e.currentTarget.dataset.url; 78 var url = e.currentTarget.dataset.url;
76 getApp().goto(url); 79 getApp().goto(url);
77 }, 80 },
78 - //获取配置信息  
79 - get_config: function() {  
80 - var th = this;  
81 - getApp().getConfig2(function(ee) {  
82 - var sms_conf = ee.switch_list;  
83 - sms_conf = JSON.parse(sms_conf);  
84 - th.setData({  
85 - is_lable_set: sms_conf.user_label_set, //是不是会员标签设置  
86 - guide_title:sms_conf.guide_consultant, //系统参数 导购标题  
87 - guide_change_time:sms_conf.guide_change_time //每月能修改几次  
88 - })  
89 - if (sms_conf.user_label_set) {  
90 - th.query_checklabels();  
91 - }  
92 - })  
93 - }, 81 +
  82 +
94 //查找会员选择的兴趣标签 83 //查找会员选择的兴趣标签
95 query_checklabels: function() { 84 query_checklabels: function() {
96 var th = this; 85 var th = this;
@@ -119,20 +108,8 @@ Page({ @@ -119,20 +108,8 @@ Page({
119 } 108 }
120 }) 109 })
121 }, 110 },
122 - //是否启动密码消费  
123 - isstcsp: function() {  
124 - var th = this;  
125 - var isstcsp = th.data.isstcsp;  
126 - if (isstcsp == 0) {  
127 - th.setData({  
128 - isstcsp: 1  
129 - })  
130 - } else {  
131 - th.setData({  
132 - isstcsp: 0  
133 - })  
134 - }  
135 - }, 111 +
  112 +
136 //出生日期是否是农历 113 //出生日期是否是农历
137 iscalendar: function() { 114 iscalendar: function() {
138 115
@@ -149,29 +126,8 @@ Page({ @@ -149,29 +126,8 @@ Page({
149 }) 126 })
150 } 127 }
151 }, 128 },
152 - //性别  
153 - isGender: function(e) {  
154 - var th = this;  
155 - var sex = e.currentTarget.dataset.sex;  
156 - th.setData({  
157 - isGender: sex  
158 - })  
159 - },  
160 - //密码是否隐藏显示  
161 - ispwhid: function() {  
162 - var th = this;  
163 - var ispwhid = th.data.ispwhid;  
164 -  
165 - if (ispwhid == 0) {  
166 - th.setData({  
167 - ispwhid: 1  
168 - })  
169 - } else {  
170 - th.setData({  
171 - ispwhid: 0  
172 - })  
173 - }  
174 - }, 129 +
  130 +
175 checkDate: function() { 131 checkDate: function() {
176 var th = this; 132 var th = this;
177 if (th.data.checkDate) { 133 if (th.data.checkDate) {
@@ -184,11 +140,7 @@ Page({ @@ -184,11 +140,7 @@ Page({
184 }) 140 })
185 } 141 }
186 }, 142 },
187 - bindChange: function(e) {  
188 - this.setData({  
189 - datet: e.detail.value,  
190 - });  
191 - }, 143 +
192 //---点击二级之后的选择--- 144 //---点击二级之后的选择---
193 choose_for_store: function(e) { 145 choose_for_store: function(e) {
194 var index_c = e.currentTarget.dataset.ind; 146 var index_c = e.currentTarget.dataset.ind;
@@ -198,6 +150,8 @@ Page({ @@ -198,6 +150,8 @@ Page({
198 fir_pick_index: index_c 150 fir_pick_index: index_c
199 }) 151 })
200 }, 152 },
  153 +
  154 +
201 //确定def_pick为选择的门店 155 //确定def_pick为选择的门店
202 sure_pick: function(e) { 156 sure_pick: function(e) {
203 var th = this; 157 var th = this;
@@ -273,8 +227,6 @@ Page({ @@ -273,8 +227,6 @@ Page({
273 }, 227 },
274 onclickstore: function() { 228 onclickstore: function() {
275 var th = this; 229 var th = this;
276 - //检验门店的点击,看下次数是不是到了  
277 - this.check_click_ok(function(){  
278 if (th.data.store == 0) { 230 if (th.data.store == 0) {
279 th.setData({ 231 th.setData({
280 store: 1 232 store: 1
@@ -432,10 +384,8 @@ Page({ @@ -432,10 +384,8 @@ Page({
432 }); 384 });
433 } 385 }
434 } 386 }
435 - }, 200)  
436 -  
437 - },2)  
438 - 387 + }, 200)
  388 +
439 }, 389 },
440 390
441 //选择更多门店 391 //选择更多门店
@@ -444,6 +394,7 @@ Page({ @@ -444,6 +394,7 @@ Page({
444 sort_store: 1 394 sort_store: 1
445 }); 395 });
446 }, 396 },
  397 +
447 //---选择分类门店--- 398 //---选择分类门店---
448 choice_sort_store: function(e) { 399 choice_sort_store: function(e) {
449 var index = e.currentTarget.dataset.index; 400 var index = e.currentTarget.dataset.index;
@@ -464,6 +415,8 @@ Page({ @@ -464,6 +415,8 @@ Page({
464 choice_sort_store: 0 415 choice_sort_store: 0
465 }); 416 });
466 }, 417 },
  418 +
  419 +
467 //身份证号严格校验 420 //身份证号严格校验
468 IdentityIDCard: function(e) { 421 IdentityIDCard: function(e) {
469 var code = e.detail.value; 422 var code = e.detail.value;
@@ -518,7 +471,7 @@ Page({ @@ -518,7 +471,7 @@ Page({
518 471
519 //区域数组中不包含需验证的身份证前两位 472 //区域数组中不包含需验证的身份证前两位
520 else if (!city[code.substr(0, 2)]) { 473 else if (!city[code.substr(0, 2)]) {
521 - errorMess = "您输入的身份证地址编码有误!"; 474 + errorMess = "您输入的身份证号格式有误!";
522 isPass = false; 475 isPass = false;
523 } else { 476 } else {
524 //18位身份证需要验证最后一位校验位 477 //18位身份证需要验证最后一位校验位
@@ -542,95 +495,108 @@ Page({ @@ -542,95 +495,108 @@ Page({
542 errorMess = "您输入的身份证号不存在!"; 495 errorMess = "您输入的身份证号不存在!";
543 isPass = false; 496 isPass = false;
544 } 497 }
545 - }  
546 - } 498 + };
  499 + };
547 var returnParam = { 500 var returnParam = {
548 'errorMess': errorMess, 501 'errorMess': errorMess,
549 'isPass': isPass 502 'isPass': isPass
550 - } 503 + };
551 if (errorMess != "") { 504 if (errorMess != "") {
552 - wx.showModal({  
553 - title: errorMess,  
554 - content: '',  
555 - showCancel: false,  
556 - confirmText: '确定',  
557 - confirmColor: '',  
558 - success: function(res) {},  
559 - fail: function(res) {},  
560 - complete: function(res) {},  
561 - })  
562 - } 505 + // wx.showModal({
  506 + // title: errorMess,
  507 + // content: '',
  508 + // showCancel: false,
  509 + // confirmText: '确定',
  510 + // confirmColor: '',
  511 + // success: function(res) {},
  512 + // fail: function(res) {},
  513 + // complete: function(res) {},
  514 + // })
  515 +
  516 + getApp().my_warnning(errorMess, 0, this);
  517 + this.setData({
  518 + id: null,
  519 + });
  520 + };
563 return returnParam; 521 return returnParam;
564 }, 522 },
565 //------初始化加载---------- 523 //------初始化加载----------
566 onLoad: function(t) { 524 onLoad: function(t) {
567 - var user = getApp().globalData.userInfo;  
568 - if (user.card_field != '' && user.card_field != null && user.card_field != undefined && user.card_expiredate) {  
569 - var now = ut.gettimestamp();  
570 - var str = user.card_expiredate.replace(/-/g, '/');;  
571 - var end = new Date(str);  
572 - end = Date.parse(end) / 1000;  
573 - if (now < end) {  
574 - this.puls_user();  
575 - }  
576 - }  
577 - this.initial_user();  
578 - },  
579 - //-----------会员是否初始化---------------------  
580 - initial_user: function() {  
581 -  
582 - var th = this;  
583 - getApp().request.get("/api/weshop/users/grade/vip/init/get", {  
584 - data: {  
585 - storeId: r.stoid,  
586 - },  
587 - success: function(su) {  
588 - var isBool = su.data.data.isBool;  
589 - th.setData({  
590 - isBool: isBool  
591 - });  
592 -  
593 - if (!isBool) return false;  
594 - //-----会员权益获取--------------  
595 - getApp().request.get("/api/weshop/users/grade/aftervipinfo/get", {  
596 - data: {  
597 - storeId: r.stoid,  
598 - userId: getApp().globalData.user_id,  
599 - },  
600 - success: function(su) {  
601 - var gradename = su.data.data.GradeName;  
602 - th.setData({  
603 - gradename: gradename  
604 - });  
605 - }  
606 - });  
607 -  
608 - }  
609 - });  
610 - this.get_config();  
611 - },  
612 525
  526 + self = this;
  527 + let url1 = '/api/weshop/storeconfig/get/';
  528 + let url3 = '/api/weshop/users/getERPUser/';
  529 + url1 += r.stoid;
  530 + var user=app.globalData.userInfo;
  531 + if(!user) return false;
  532 +
  533 + //-- 赋予默认值 --
  534 + app.request.get(url1, {
  535 + success: function(res) {
  536 + console.log('x-->', res.data.code, res.data.data.reg_type, res.data.data.reg_info);
  537 + if(res.data.code == 0) {
  538 + let reg_type = res.data.data.reg_type;
  539 + let reg_info = res.data.data.reg_info;
  540 + if(reg_type) { //reg_type为1才显示积分信息
  541 + if(reg_info) {
  542 + reg_info = JSON.parse(reg_info);
  543 + if(reg_info.reginfo_coupon){
  544 + //判断有没有领过券
  545 + self.check_is_send_quan(reg_info.reginfo_coupon,user.user_id);
  546 + }
  547 + };
  548 + };
  549 + self.setData({
  550 + reg_type,
  551 + reg_info,
  552 + user: app.globalData.userInfo,
  553 + });
  554 + };
  555 +
  556 + },
  557 + });
  558 +
  559 + //获取默认信息
  560 + url3 += r.stoid + "/" +user.user_id;
  561 + app.request.get(url3, {
  562 + success: function(res) {
  563 + if(res.data.code == 0) {
  564 + console.log('url3', res.data.data.birthday);
  565 + let data = res.data.data;
  566 + if(data['idcard']) self.data.id=data['idcard'];
  567 + if(data['vipname']) self.data.name=data['vipname'];
  568 + if(data['address']) self.data.address=data['address'];
613 569
614 - //-----Plus会员获取-----------  
615 - puls_user: function() {  
616 - var th = this;  
617 - getApp().request.get("/api/weshop/plus/vip/mem/list", {  
618 - data: {  
619 - storeId: r.stoid,  
620 - userId: getApp().globalData.user_id,  
621 - },  
622 - success: function(su) { 570 + if(data.birthday){
  571 + data.birthday= ut.formar_no_full(data.birthday);
  572 + }
  573 + if(!data.pickup_name){
  574 + data.pickup_name="";
  575 + }
  576 + if(!data.pickup_id){
  577 + data.pickup_id=0;
  578 + }
  579 + //-- 获取门店 --
  580 + self.setData({
  581 + isGender: data.sex,
  582 + isLunar: data.islunar,
  583 + datet: data.birthday,
  584 + stoname: data.pickup_name,
  585 + sto_sele_id: data.pickup_id,
  586 + vip_user:data
  587 + });
623 588
624 - if (su.data.code == 0) {  
625 - var cardname = su.data.data[0].MemCardName;  
626 - th.setData({  
627 - pulscardname: cardname  
628 - });  
629 - }  
630 - }  
631 - }); 589 + };
  590 + }
  591 + });
  592 +
  593 + if(user){
  594 + getApp().promiseGet("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + user.user_id,{});
  595 + self.setData({user:user})
  596 + }
  597 +
632 }, 598 },
633 - 599 +
634 onShow: function() { 600 onShow: function() {
635 var e = this; 601 var e = this;
636 if (this.data.is_zy) return false; 602 if (this.data.is_zy) return false;
@@ -644,44 +610,7 @@ Page({ @@ -644,44 +610,7 @@ Page({
644 } 610 }
645 611
646 var req = t; 612 var req = t;
647 - req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, {  
648 - success: function(src) {  
649 - var a = src.data.data;  
650 -  
651 - if(!a) a={};  
652 - var time ="",birthday ="";  
653 - if(a && a.reg_time) time=util.formatTime(a.reg_time, "'Y/M/D");  
654 - if(a && a.birthday) birthday=util.formatTime(a.birthday, "'Y/M/D");  
655 -  
656 - a.reg_time = time;  
657 - a.birthday = birthday  
658 -  
659 - if(a.address=='null' || !a.address){  
660 - a.address="";  
661 - }  
662 -  
663 - e.data.fir_guide_id=a.staffId;  
664 - if(choice_guide){  
665 - a.staffName=choice_guide.StaffName;  
666 - a.staffId=choice_guide.Id;  
667 - }  
668 -  
669 -  
670 - e.setData({  
671 - phone: a.mobile,  
672 - user: a,  
673 - openid: a.openid,  
674 - sto_sele_id: a.pickup_id,  
675 - consumption: a.paypwd,  
676 - identity_card: a.idcard,  
677 - address: a.address,  
678 - isGender: a.sex,  
679 - isstcsp: a.vipnopwd,  
680 - iscalendar:a.islunar  
681 - });  
682 -  
683 - }  
684 - }) 613 +
685 a.getUserInfo(function(a) { 614 a.getUserInfo(function(a) {
686 var txt = util.formatTime(a.birthday, 'yyyy-M-d'), 615 var txt = util.formatTime(a.birthday, 'yyyy-M-d'),
687 arr = txt.split(' '); 616 arr = txt.split(' ');
@@ -695,52 +624,47 @@ Page({ @@ -695,52 +624,47 @@ Page({
695 if(da.data.data){ 624 if(da.data.data){
696 //设置门店 625 //设置门店
697 e.setData({ 626 e.setData({
698 - stoname: da.data.data.pickup_name 627 + // stoname: da.data.data.pickup_name
699 }); 628 });
700 } 629 }
701 630
702 } 631 }
703 }) 632 })
704 } 633 }
705 - // var phone = "";  
706 - // phone+=a.mobile.substr(0, 3)+"****";  
707 - // phone += a.mobile.substr(7, 12);  
708 -  
709 -  
710 -  
711 - // e.setData({  
712 - // isGender:e.data.user.sex  
713 - // }) 634 +
714 }, !0); 635 }, !0);
715 }, 636 },
716 637
717 - editUserInfo: function(e) {  
718 - var r = e.currentTarget.dataset.type;  
719 - if (("password" == r || "paypwd" == r) && !this.data.user.mobile) return a.showWarning("请先绑定手机号码");  
720 - r && this.data.user && wx.navigateTo({  
721 - url: "/pages/user/userinfo_edit/userinfo_edit?type=" + r  
722 - });  
723 - },  
724 -  
725 - /*--------------------修改头像---------------------*/  
726 - changeAvatar: function() {  
727 - return false;  
728 - var r = this;  
729 - wx.chooseImage({  
730 - count: 1,  
731 - sizeType: ["compressed", "original"],  
732 - sourceType: ["camera", "album"],  
733 - success: function(u) {  
734 - t.uploadFile(r.data.url + "/api/user/upload_headpic", {  
735 - filePath: u.tempFilePaths[0],  
736 - name: "head_pic",  
737 - success: function(t) {  
738 - var u = s.getFullUrl(t.data.result);  
739 - r.setData(e({}, "user.head_pic", u)), a.globalData.userInfo.head_pic = u, a.showSuccess("设置头像成功");  
740 - }  
741 - });  
742 - }  
743 - }); 638 + check_is_send_quan:function(cid,uid){
  639 + var self=this;
  640 + let url2 = '/api/weshop/prom/coupon/get/';
  641 + //看一下会员有没有领过注册的券
  642 + getApp().promiseGet("/api/weshop/couponList/page",{
  643 + data:{store_id:r.stoid,uid:uid,cid:cid}
  644 + }).then(res=>{
  645 + var is_ling=0;
  646 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  647 + is_ling=1;
  648 + }
  649 +
  650 + //没有领过券,就显示
  651 + if(!is_ling){
  652 + //获取优惠券
  653 + url2 += cid;
  654 + app.request.get(url2, {
  655 + success: function(r) {
  656 + if(r.data.code == 0) {
  657 + console.log('000res==>', r.data.data.name);
  658 + self.setData({
  659 + couponInfo: r.data.data.name,
  660 + });
  661 + };
  662 + },
  663 + });
  664 + }
  665 +
  666 + })
  667 +
744 }, 668 },
745 669
746 670
@@ -762,14 +686,8 @@ Page({ @@ -762,14 +686,8 @@ Page({
762 tc_hide: true, 686 tc_hide: true,
763 }); 687 });
764 }, 688 },
765 - //消费密码输入框失去焦点事件  
766 - lose_focus: function(e) {  
767 - var th = this;  
768 - var val = e.detail.value;  
769 - this.setData({  
770 - consumption: val  
771 - })  
772 - }, 689 +
  690 +
773 691
774 //地址 692 //地址
775 address: function(e) { 693 address: function(e) {
@@ -779,28 +697,7 @@ Page({ @@ -779,28 +697,7 @@ Page({
779 }); 697 });
780 }, 698 },
781 699
782 - //身份证验证  
783 - identity_card: function(e) {  
784 - var val = e.detail;  
785 -  
786 - this.setData({  
787 - identity_card: val.value  
788 - });  
789 -  
790 - },  
791 - //用户名字  
792 - user_name: function(e) {  
793 - var th = this;  
794 - var name = e.detail.value;  
795 - var vipname = 'user.vipname';  
796 - if (name != "" || name != null) {  
797 - th.setData({  
798 - [vipname]: name  
799 - });  
800 - }  
801 -  
802 - },  
803 - 700 +
804 //点击确认修改信息 701 //点击确认修改信息
805 confirm_revision: function() { 702 confirm_revision: function() {
806 var th = this; 703 var th = this;
@@ -878,13 +775,13 @@ Page({ @@ -878,13 +775,13 @@ Page({
878 // this.setData({ is_zy: 1 }); 775 // this.setData({ is_zy: 1 });
879 }, 776 },
880 //更换手机 777 //更换手机
881 - go_phone: function(e) {  
882 - var url = e.currentTarget.dataset.url;  
883 - this.setData({  
884 - is_zy: 1  
885 - });  
886 - getApp().goto(url);  
887 - }, 778 + // go_phone: function(e) {
  779 + // var url = e.currentTarget.dataset.url;
  780 + // this.setData({
  781 + // is_zy: 1
  782 + // });
  783 + // getApp().goto(url);
  784 + // },
888 785
889 //--点击分享事件--- 786 //--点击分享事件---
890 onShareAppMessage: function(t) { 787 onShareAppMessage: function(t) {
@@ -911,7 +808,340 @@ Page({ @@ -911,7 +808,340 @@ Page({
911 } 808 }
912 } 809 }
913 }); 810 });
914 - } 811 + },
  812 +
  813 + //获取输入框内容
  814 + getInput(e) {
  815 + return e.detail.value;
  816 + },
  817 +
  818 + verifyInput(e) {
  819 + let value = e.detail.value;
  820 + if (value == "" || value == null || value == undefined) {
  821 + app.my_warnning("请输入", 0, this);
  822 + }
  823 + },
  824 +
  825 + //获取推荐人
  826 + getReferee(e) {
  827 + let referee = this.getInput(e);
  828 + this.data.referee = referee;
  829 + console.log(referee);
  830 + },
  831 +
  832 + //获取姓名
  833 + getName(e) {
  834 + let name = this.getInput(e);
  835 + this.data.name = name;
  836 + },
  837 +
  838 + //获取性别
  839 + getGender(e) {
  840 + let sex = e.currentTarget.dataset.sex;
  841 + this.setData({
  842 + isGender: sex,
  843 + });
  844 + },
  845 +
  846 + //获取身份证
  847 + getId(e) {
  848 + let id = this.getInput(e);
  849 + this.data.id = id;
  850 + },
  851 +
  852 + //验证身份证号码
  853 + // verifyId(e) {
  854 + // let id = this.data.id;
  855 + // if(id) {
  856 + // if (id != null && id != undefined && id != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(id))) {
  857 + // getApp().my_warnning("身份证号码无效!", 0, this);
  858 + // }
  859 + // };
  860 + // },
  861 +
  862 + //获取地址
  863 + getAddress(e) {
  864 + let address = this.getInput(e);
  865 + this.data.address = address;
  866 + },
  867 +
  868 + //获取生日
  869 + bindChange: function(e) {
  870 + let strBirthday = e.detail.value;
  871 + let age = this.verifyBirthday(strBirthday);
  872 +
  873 + if(age <= 10) {
  874 + app.my_warnning("会员年龄不能小于10岁(含10岁)", 0, this);
  875 + } else if(age >= 70) {
  876 + app.my_warnning("会员年龄不能超过70岁(含70岁)", 0, this);
  877 + } else {
  878 + this.setData({
  879 + datet: e.detail.value,
  880 + });
  881 + };
  882 +
  883 + // console.log(this.data.datet, this.data.isCalendar);
  884 + },
  885 +
  886 + // 生日判断
  887 + verifyBirthday(strBirthday) {
  888 + var returnAge;
  889 + var strBirthdayArr = strBirthday.split("-");
  890 + var birthYear = strBirthdayArr[0];
  891 + var birthMonth = strBirthdayArr[1];
  892 + var birthDay = strBirthdayArr[2];
  893 +
  894 + d = new Date();
  895 + var nowYear = d.getFullYear();
  896 + var nowMonth = d.getMonth() + 1;
  897 + var nowDay = d.getDate();
  898 +
  899 + if(nowYear == birthYear){
  900 + returnAge = 0;//同年 则为0岁
  901 + } else {
  902 + var ageDiff = nowYear - birthYear ; //年之差
  903 + if(ageDiff > 0){
  904 + if(nowMonth == birthMonth) {
  905 + var dayDiff = nowDay - birthDay;//日之差
  906 + if(dayDiff < 0)
  907 + {
  908 + returnAge = ageDiff - 1;
  909 + }
  910 + else
  911 + {
  912 + returnAge = ageDiff ;
  913 + }
  914 + }
  915 + else
  916 + {
  917 + var monthDiff = nowMonth - birthMonth;//月之差
  918 + if(monthDiff < 0)
  919 + {
  920 + returnAge = ageDiff - 1;
  921 + }
  922 + else
  923 + {
  924 + returnAge = ageDiff ;
  925 + }
  926 + }
  927 + }
  928 + else
  929 + {
  930 + returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
  931 + }
  932 + }
  933 + return returnAge;//返回周岁年龄
  934 + },
  935 +
  936 + //是否为农历
  937 + isLunar(e) {
  938 + let isLunar = null;
  939 + if(e.detail.value[0]) {
  940 + isLunar = 1;
  941 + } else {
  942 + isLunar = 0;
  943 + };
  944 + this.data.isLunar = isLunar;
  945 + // console.log(isLunar);
  946 + },
  947 +
  948 + // 是否同意协议
  949 + isAgree(e) {
  950 + let isAgree = null;
  951 + if(e.detail.value[0]) {
  952 + isAgree = true;
  953 + } else {
  954 + isAgree = false;
  955 + };
  956 + // this.data.isAgree = isAgree;
  957 + this.setData({
  958 + isAgree,
  959 + });
  960 + console.log(isAgree);
  961 + },
  962 +
  963 +
  964 + //保存
  965 + save: function() {
  966 + var th = this;
  967 + var sto_sele_id = this.data.sto_sele_id;
  968 + var user=app.globalData.userInfo;
  969 +
  970 + var data = {
  971 + store_id: r.stoid,
  972 + user_id: app.globalData.user_id,
  973 + };
  974 +
  975 + //-- 需要推荐人 --
  976 + if(this.data.reg_info.introducer_state){
  977 + let tjrname = this.data.referee;
  978 + if (tjrname == "" || tjrname == null) {
  979 + app.my_warnning("请输入推荐人", 0, this);
  980 + return false;
  981 + };
  982 + if(tjrname==user.mobile || tjrname==user.erpvipno ){
  983 + app.my_warnning("推荐人不能是自己", 0, this);
  984 + return false;
  985 + }
  986 + data.tjrname=tjrname;
  987 + }
  988 +
  989 + //-- 需要姓名 --
  990 + if(this.data.reg_info.name_state){
  991 + let vipname = this.data.name;
  992 + if (vipname == "" || vipname == null) {
  993 + app.my_warnning("请输入姓名", 0, this);
  994 + return false;
  995 + };
  996 + data.vipname=vipname;
  997 + }
  998 + //需要性别
  999 + if(this.data.reg_info.sex_state){
  1000 + let sex = this.data.isGender;
  1001 + if (sex != "1" && sex != "2") {
  1002 + app.my_warnning("请选择性别", 0, this);
  1003 + return false;
  1004 + };
  1005 + data.sex=sex;
  1006 + }
  1007 +
  1008 + //需要生日
  1009 + if(this.data.reg_info.birthday_state){
  1010 + let birthday = this.data.datet;
  1011 + if (birthday == "" || birthday == null) {
  1012 + app.my_warnning("请选择出生日期", 0, this);
  1013 + return false;
  1014 + };
  1015 +
  1016 + data.birthday=birthday;
  1017 + data.islunar=self.data.isLunar;
  1018 + }
  1019 +
  1020 + //-- 需要身份证 --
  1021 + if(this.data.reg_info.idcard_state){
  1022 + let idcard = this.data.id;
  1023 + if (idcard == "" || idcard == null) {
  1024 + app.my_warnning("请输入身份证号码", 0, this);
  1025 + return false;
  1026 + };
  1027 + data.idcard=idcard;
  1028 + }
  1029 + //需要地址
  1030 + if(this.data.reg_info.address_state){
  1031 + let address = this.data.address;
  1032 + if (address == "" || address == null) {
  1033 + app.my_warnning("请输入地址", 0, this);
  1034 + return false;
  1035 + };
  1036 + data.address=address;
  1037 + }
  1038 + //需要门店
  1039 + if(this.data.reg_info.pick_state){
  1040 + let pickup_id = sto_sele_id;
  1041 + if (pickup_id == "" || pickup_id == null) {
  1042 + app.my_warnning("请输入门店", 0, this);
  1043 + return false;
  1044 + };
  1045 + data.pickup_id=sto_sele_id;
  1046 + }
  1047 +
  1048 + let isAgree = this.data.isAgree;
  1049 + if(!isAgree) {
  1050 + app.my_warnning("请您先阅读和勾选指定的内容", 0, this);
  1051 + return false;
  1052 + };
  1053 +
  1054 +
  1055 + console.log('data==>', data);
  1056 +
  1057 + app.request.put("/api/weshop/users/updateInfo", {
  1058 + data: data,
  1059 + success: function(res) {
  1060 + if (res.data.code == 0) {
  1061 + getApp().my_warnning("保存成功", 1, self);
  1062 + getApp().goto("/pages/user/index/index");
  1063 + } else {
  1064 + getApp().my_warnning(res.data.msg, 0, self);
  1065 + };
  1066 + }
  1067 + })
  1068 +
  1069 + // } else {
  1070 + // app.my_warnning("请您先阅读和勾选指定的内容", 0, self);
  1071 + // };
  1072 + // var isstcsp = th.data.isstcsp; //是否启用消费密码
  1073 + // var phone = th.data.phone; //手机号码
  1074 + // if (phone == "" || phone == null) {
  1075 + // getApp().my_warnning("手机不能为空", 0, th);
  1076 + // return false;
  1077 + // }
  1078 + // var consumption = th.data.consumption; //消费密码
  1079 + // var isstcsp = th.data.isstcsp;
  1080 + // if (isstcsp == 1) {
  1081 +
  1082 + // if (consumption == null || consumption == "" || consumption == undefined) {
  1083 + // getApp().my_warnning("消费密码不能为空", 0, th);
  1084 + // return false;
  1085 + // }
  1086 + // if (consumption.length < 6) {
  1087 + // getApp().my_warnning("消费密码不能小于6位", 0, th);
  1088 + // return false;
  1089 + // }
  1090 + // }
  1091 + // var sex = th.data.isGender; //性别
  1092 +
  1093 + // if (sex != "1" && sex != "2") {
  1094 + // getApp().my_warnning("请选择性别", 0, th);
  1095 + // return false;
  1096 + // }
  1097 + // var vipname = th.data.user.vipname; //用户姓名
  1098 + // if (user_name == "" || user_name == null) {
  1099 + // getApp().my_warnning("请输入名字", 0, th);
  1100 + // return false;
  1101 + // }
  1102 + // var identity_card = th.data.identity_card; //身份证
  1103 +
  1104 + // if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) {
  1105 + // getApp().my_warnning("身份证号码错误", 0, th);
  1106 + // return false;
  1107 + // }
  1108 + // var address = th.data.address; //地址
  1109 + // var sto_sele_id = self.data.sto_sele_id;
  1110 + // var data = {
  1111 + // store_id: r.stoid,
  1112 + // user_id: app.globalData.user_id,
  1113 + // tjrname: self.data.referee, //推荐人
  1114 + // vipname: self.data.name, //名称
  1115 + // sex: self.data.isGender, //性别
  1116 + // birthday: self.data.datet,
  1117 + // islunar: self.data.isLunar,
  1118 + // idcard: self.data.id,
  1119 + // address: self.data.address,
  1120 + // pickup_id: sto_sele_id ,//自提门店 所属门店
  1121 + // };
  1122 +
  1123 + // console.log('data==>', data);
  1124 + //往上提交美导的ID
  1125 + // if(th.data.fir_guide_id!=th.data.user.staffId){
  1126 + // datas.staffId=th.data.user.staffId;
  1127 + // }
  1128 +
  1129 + // app.request.put("/api/weshop/users/updateInfo", {
  1130 + // data: data,
  1131 + // success: function(res) {
  1132 + // if (res.data.code == 0) {
  1133 + // getApp().my_warnning("保存成功", 1, self);
  1134 + // getApp().goto("/pages/user/index/index");
  1135 + // } else {
  1136 + // getApp().my_warnning("系统繁忙,请稍后再试", 0, self);
  1137 + // };
  1138 + // }
  1139 + // })
  1140 + },
  1141 +
  1142 +
  1143 +
  1144 +
915 1145
916 1146
917 }); 1147 });
918 \ No newline at end of file 1148 \ No newline at end of file
packageA/pages/profile/profile.wxml
@@ -24,22 +24,32 @@ @@ -24,22 +24,32 @@
24 24
25 <view class="user-container"> 25 <view class="user-container">
26 <view class="Bbottom"> 26 <view class="Bbottom">
27 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname"> 27 +
  28 + <!-- 如果需要接骚人信息 -->
  29 + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
28 <view class="user-name-txt">推荐人:</view> 30 <view class="user-name-txt">推荐人:</view>
29 - <input bindblur="user_name" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>  
30 - <view class="c-red pdl20 fs24">可获10积分</view> 31 + <input bindinput="getReferee" bindblur="" value="{{vip_user['fromuser_id']?vip_user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>
  32 +
  33 + <block wx:if="{{!vip_user['fromuser_id']}}">
  34 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
  35 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
  36 + </block>
31 </view> 37 </view>
32 -  
33 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname">  
34 - <view class="user-name-txt">姓名:</view>  
35 - <input bindblur="user_name" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>  
36 - <view class="c-red pdl20 fs24">可获10积分</view> 38 +
  39 + <!-- 如果需要接姓名信息 -->
  40 + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}">
  41 + <view class="user-name-txt">姓名:</view>
  42 + <input bindinput="getName" bindblur="" value="{{vip_user['vipname']?vip_user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
  43 + <block wx:if="{{!vip_user['vipname']}}">
  44 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>
  45 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
  46 + </block>
37 </view> 47 </view>
38 48
39 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="sex"> 49 + <view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.sex_state }}">
40 <view>性别:</view> 50 <view>性别:</view>
41 <view class="flex f1 pdl20 jc_fe"> 51 <view class="flex f1 pdl20 jc_fe">
42 - <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="isGender"> 52 + <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="getGender">
43 <block wx:if="{{isGender==1}}"> 53 <block wx:if="{{isGender==1}}">
44 <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malealready.png"></image> 54 <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malealready.png"></image>
45 </block> 55 </block>
@@ -48,7 +58,7 @@ @@ -48,7 +58,7 @@
48 </block> 58 </block>
49 <view class="fs24">男</view> 59 <view class="fs24">男</view>
50 </view> 60 </view>
51 - <view class="flex-center {{isGender==2?'Gendercheck':'Gender'}} mgl20" data-sex="2" bindtap="isGender"> 61 + <view class="flex-center {{isGender==2?'Gendercheck':'Gender'}} mgl20" data-sex="2" bindtap="getGender">
52 <block wx:if="{{isGender==2}}"> 62 <block wx:if="{{isGender==2}}">
53 <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalealready.png"></image> 63 <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalealready.png"></image>
54 </block> 64 </block>
@@ -58,86 +68,103 @@ @@ -58,86 +68,103 @@
58 <view class="fs26">女</view> 68 <view class="fs26">女</view>
59 </view> 69 </view>
60 </view> 70 </view>
61 - <view class="c-red pdl20 fs24">可获10积分</view> 71 +
  72 + <block wx:if="{{!vip_user['sex']}}">
  73 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>
  74 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
  75 + </block>
62 </view> 76 </view>
63 77
64 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="sex"> 78 + <view class="user-name flex-vertical" data-type="birthday" wx:if="{{reg_info.birthday_state}}" style="justify-content: space-between;">
65 <view class="shrink0">出生日期:</view> 79 <view class="shrink0">出生日期:</view>
66 <view class="flex fs28 Birth pdl20 jc_fe"> 80 <view class="flex fs28 Birth pdl20 jc_fe">
67 - <view class="flex" bindtap="iscalendar">  
68 -  
69 - <block wx:if="{{iscalendar}}">  
70 - <view class="flex-center">  
71 - <icon size="20" type="success" color="rgb(212,2,31)"></icon>  
72 - </view>  
73 - </block>  
74 - <block wx:else>  
75 - <icon size="20" type="success" color="rgb(0, 0, 0, 0.4)"></icon>  
76 - </block>  
77 -  
78 -  
79 - <view class="flex-center">  
80 - <view class="Mleft">农历</view>  
81 - </view>  
82 - </view>  
83 - <view class="user-txt-right pdl20">  
84 - <!-- 填充数据的时候要判断是否已经有出生日期,有值的话就不可修改 -->  
85 - <block wx:if="{{user.birthday==''||user.birthday==null}}">  
86 - <picker bindchange='bindChange' value="{{datet}}" mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">  
87 - {{datet?datet:"请选择时间"}} 81 + <view class="user-txt-right pdl20 flex ai-center">
  82 + <checkbox-group bindchange="isLunar">
  83 + <label class="flex ai-center">
  84 + <checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历
  85 + </label>
  86 + </checkbox-group>
  87 + <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
  88 + <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view>
88 </picker> 89 </picker>
89 - </block>  
90 - <block wx:else>  
91 - <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view>  
92 - </block> 90 +
93 91
94 </view> 92 </view>
95 </view> 93 </view>
96 - <view class="c-red pdl20 fs24 shrink0">可获10积分</view> 94 +
  95 + <block wx:if="{{!vip_user['birthday']}}">
  96 + <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>
  97 + <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view>
  98 + </block>
97 </view> 99 </view>
98 100
99 101
100 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname">  
101 - <view class="user-name-txt shrink0">身份证号码:</view>  
102 - <input bindblur="identity_card" class="user-txt-right pdl20 f1 t-r" value="{{user.idcard}}" placeholder="请输入身份证号码"></input>  
103 - <view class="c-red pdl20 fs24 shrink0">可获10积分</view> 102 + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}">
  103 + <view class="user-name-txt shrink0">身份证:</view>
  104 + <input bindinput="getId" bindblur="IdentityIDCard" value="{{vip_user.idcard}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input>
  105 + <block wx:if="{{!vip_user.idcard}}">
  106 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view>
  107 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view>
  108 + </block>
104 </view> 109 </view>
105 110
106 111
107 - <view class="user-name flex-vertical" data-type="mobile"> 112 + <view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}">
108 <view class="user-name-txt">地址:</view> 113 <view class="user-name-txt">地址:</view>
109 - <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />  
110 - <view class="c-red pdl20 fs24">可获10积分</view> 114 + <input bindinput="getAddress" bindblur="" value="{{vip_user.address?vip_user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
  115 + <block wx:if="{{!vip_user.address}}">
  116 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>
  117 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view>
  118 + </block>
111 </view> 119 </view>
112 120
113 -  
114 - <view bindtap="" class="user-name flex-vertical" data-type="mobile">  
115 - <view class="user-name-txt">手机:</view>  
116 - <input bindblur="" class="user-txt-right f1 pdl20 t-r" placeholder="请输入手机号码"/>  
117 - <view class="c-red pdl20 fs24">可获10积分</view>  
118 - </view>  
119 -  
120 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname">  
121 - <view class="user-name-txt">验证码:</view>  
122 - <input bindblur="" class="user-txt-right f1 pdl20 t-r" placeholder="请输入"/>  
123 - <view class="mgl20 fs24 btn pd10">获取验证码</view>  
124 - </view>  
125 -  
126 - 121 +
127 <!-- 选择门店 --> 122 <!-- 选择门店 -->
128 - <view bindtap="onclickstore" class="user-name flex-vertical" data-type="email"> 123 + <view bindtap="onclickstore" class="user-name flex-vertical" data-type="email" wx:if="{{reg_info.pick_state}}">
129 <view class="user-name-txt">所属门店:</view> 124 <view class="user-name-txt">所属门店:</view>
130 <view class="user-txt-right f1 flex ai_c jc_fe"> 125 <view class="user-txt-right f1 flex ai_c jc_fe">
131 - <view class="one-line">{{stoname}}</view> 126 + <view class="one-line">{{stoname?stoname:'请选择门店'}}</view>
132 <view class="angle">∟</view> 127 <view class="angle">∟</view>
133 </view> 128 </view>
134 - <view class="c-red pdl20 fs24">可获10积分</view> 129 +
  130 + <block wx:if="{{!vip_user.pickup_id}}">
  131 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view>
  132 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
  133 + </block>
135 </view> 134 </view>
136 135
  136 + <!-- 我的兴趣 -->
  137 + <view wx:if="{{ isBool==1 && is_lable_set==1}}" class="padding Bbottom">
  138 + <!-- 我的兴趣 -->
  139 + <view wx:if="{{is_lable_set!=null && is_lable_set==1}}" class="Bbottom">
  140 + <view class="interest fs28">
  141 + <view class="flex-vertical-between" bindtap="goto" data-url="/pages/user/labels/labels">
  142 + <view class="fs30">我的兴趣</view>
  143 + <view class="angle">∟</view>
  144 + </view>
  145 + <!-- 选中的标签 -->
  146 + <view class="lables">
  147 + <block wx:if="{{check_label.length>0}}">
  148 + <view class="lable" wx:for="{{check_label}}" wx:for-item="label">
  149 + <view class="ellipsis-1">{{label}}</view>
  150 + </view>
  151 + </block>
  152 + <!-- 添加标签按钮 -->
  153 + <view class="add_lable ib ellipsis-1" bindtap="goto" data-url="/pages/user/labels/labels">
  154 + <text class="plus">+</text>
  155 + <text>标签</text>
  156 + </view>
  157 + </view>
  158 + </view>
  159 + </view>
  160 + </view>
  161 +
137 162
138 <view bindtap="" class="user-name flex-vertical fs24"> 163 <view bindtap="" class="user-name flex-vertical fs24">
139 - <checkbox/>  
140 - <view class="user-name-txt">我已阅读同意 <text class="red">《用户使用协议》</text>与<text class="red">《隐私政策》</text></view> 164 + <checkbox-group bindchange="isAgree">
  165 + <checkbox value="true"/>
  166 + </checkbox-group>
  167 + <view class="user-name-txt">我已阅读同意 <text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
141 </view> 168 </view>
142 169
143 </view> 170 </view>
@@ -145,8 +172,8 @@ @@ -145,8 +172,8 @@
145 172
146 <!-- 保存按钮 --> 173 <!-- 保存按钮 -->
147 <view class="confirm"> 174 <view class="confirm">
148 - <view class="fs30 confirmtext" bindtap="confirm_revision">保存</view>  
149 - <view class="star fs24 t-c pdt10 c9">保存成功即可获得一张20.00元优惠券</view> 175 + <view class="fs30 confirmtext" bindtap="save">保存</view>
  176 + <view class="star fs24 t-c pdt10 c9" wx:if="{{couponInfo}}">保存成功即可获得一张{{couponInfo}}</view>
150 </view> 177 </view>
151 178
152 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"--> 179 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"-->
packageA/pages/profile/profile.wxss
@@ -623,7 +623,7 @@ input { @@ -623,7 +623,7 @@ input {
623 } 623 }
624 624
625 .interest { 625 .interest {
626 - padding: 0rpx 20rpx; 626 + /* padding: 0rpx 20rpx; */
627 padding-top: 30rpx; 627 padding-top: 30rpx;
628 padding-bottom: 30rpx; 628 padding-bottom: 30rpx;
629 } 629 }
packageA/pages/service_share/service_share.js
@@ -145,9 +145,9 @@ Page({ @@ -145,9 +145,9 @@ Page({
145 var item=this.data.share_good; 145 var item=this.data.share_good;
146 var price = item.money; 146 var price = item.money;
147 var title= item.serviceName; 147 var title= item.serviceName;
148 - var img=this.data.url+item.original_img; 148 + var img=this.data.url+item.imgUrl;
149 149
150 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; 150 + var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.id;
151 if(getApp().globalData.user_id){ 151 if(getApp().globalData.user_id){
152 url+="&first_leader="+getApp().globalData.user_id; 152 url+="&first_leader="+getApp().globalData.user_id;
153 } 153 }
@@ -777,7 +777,7 @@ Page({ @@ -777,7 +777,7 @@ Page({
777 var ee = this; 777 var ee = this;
778 //获取商品是分享图信息 778 //获取商品是分享图信息
779 wx.getImageInfo({ 779 wx.getImageInfo({
780 - src: ee.data.url+ee.data.share_good.original_img, 780 + src: ee.data.url+ee.data.share_good.imgUrl,
781 success: function(res) { 781 success: function(res) {
782 //res.path是网络图片的本地地址 782 //res.path是网络图片的本地地址
783 ee.data.share_goods_img = res.path; 783 ee.data.share_goods_img = res.path;
@@ -837,7 +837,7 @@ Page({ @@ -837,7 +837,7 @@ Page({
837 go_goods:function(e){ 837 go_goods:function(e){
838 var index=e.currentTarget.dataset.index; 838 var index=e.currentTarget.dataset.index;
839 var item=this.data.list[index]; 839 var item=this.data.list[index];
840 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; 840 + var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.id;
841 getApp().goto(url); 841 getApp().goto(url);
842 }, 842 },
843 843
packageA/pages/service_share/service_share.wxml
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 </view> 45 </view>
46 <view class="details"> 46 <view class="details">
47 <view class="ellipsis-2 fs28 name">{{item.serviceName}}</view> 47 <view class="ellipsis-2 fs28 name">{{item.serviceName}}</view>
48 - <view class="fs26 pdt10">有效天数:{{item.validDays}}</view> 48 + <view class="fs26 pdt10">有效天数:{{item.validDays?item.validDays:'不限'}}</view>
49 <view class="flex ai-center pdt14 jc_sb"> 49 <view class="flex ai-center pdt14 jc_sb">
50 <view class="red fs26">¥{{item.money}}</view> 50 <view class="red fs26">¥{{item.money}}</view>
51 <view class="gray fs24">已售:<text class="red">{{item.sales_sum}}</text></view> 51 <view class="gray fs24">已售:<text class="red">{{item.sales_sum}}</text></view>
pages/activity/pind_list/pind_list.js
@@ -20,6 +20,7 @@ Page({ @@ -20,6 +20,7 @@ Page({
20 20
21 //------初始化加载---------- 21 //------初始化加载----------
22 onLoad: function(t) { 22 onLoad: function(t) {
  23 + wx.setNavigationBarTitle({ title: "天天拼单",})
23 var first_leader = t.first_leader; 24 var first_leader = t.first_leader;
24 var th=this; 25 var th=this;
25 26
@@ -54,10 +55,10 @@ Page({ @@ -54,10 +55,10 @@ Page({
54 }, 55 },
55 56
56 onShow: function(t) { 57 onShow: function(t) {
57 -  
58 - wx.setNavigationBarTitle({ title: "天天拼单",}) 58 +
59 this.data.is_timer=1; 59 this.data.is_timer=1;
60 this.data.currentPage=1; 60 this.data.currentPage=1;
  61 + this.data.ismore=1;
61 this.setData({goodlist:null}); 62 this.setData({goodlist:null});
62 var th=this; 63 var th=this;
63 this.requestSalelist(); 64 this.requestSalelist();
pages/activity/pind_list/pind_list.wxml
1 -<block wx:if="{{isshow}}">  
2 -  
3 <view class=" body_frame"> 1 <view class=" body_frame">
4 2
5 <block wx:if="{{ad_data}}"> 3 <block wx:if="{{ad_data}}">
@@ -89,6 +87,7 @@ @@ -89,6 +87,7 @@
89 87
90 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view> 88 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
91 </view> 89 </view>
92 -</block> 90 +
  91 +
93 92
94 <share_box id="share"></share_box> 93 <share_box id="share"></share_box>
95 \ No newline at end of file 94 \ No newline at end of file
pages/activity/seckill_list/seckill_list.js
@@ -16,6 +16,8 @@ Page({ @@ -16,6 +16,8 @@ Page({
16 16
17 //------初始化加载---------- 17 //------初始化加载----------
18 onLoad: function(t) { 18 onLoad: function(t) {
  19 + wx.setNavigationBarTitle({ title: "商品秒杀",})
  20 +
19 var first_leader = t.first_leader; 21 var first_leader = t.first_leader;
20 var th=this; 22 var th=this;
21 23
@@ -51,10 +53,8 @@ Page({ @@ -51,10 +53,8 @@ Page({
51 }, 53 },
52 54
53 55
54 - onShow: function(t) {  
55 -  
56 - wx.setNavigationBarTitle({ title: "商品秒杀",})  
57 - 56 + onShow: function(t) {
  57 + this.data.ismore=1;
58 this.data.is_timer=1; 58 this.data.is_timer=1;
59 this.data.currentPage=1; 59 this.data.currentPage=1;
60 var th=this;th.setData({goodlist:null,}) 60 var th=this;th.setData({goodlist:null,})
pages/activity/seckill_list/seckill_list.wxml
1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs> 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 -<block wx:if="{{isshow}}"> 2 +
3 <view class=" body_frame"> 3 <view class=" body_frame">
4 4
5 <block wx:if="{{ad_data}}"> 5 <block wx:if="{{ad_data}}">
@@ -76,6 +76,6 @@ @@ -76,6 +76,6 @@
76 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view> 76 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
77 </view> 77 </view>
78 78
79 -</block> 79 +
80 80
81 <share_box id="share"></share_box> 81 <share_box id="share"></share_box>
pages/cart/cart/cart.js
@@ -783,7 +783,7 @@ Page({ @@ -783,7 +783,7 @@ Page({
783 isShowLoading: 0, 783 isShowLoading: 0,
784 success: function(res_d) { 784 success: function(res_d) {
785 785
786 - if(res_d.data.code==0){ 786 + if(res_d.data.code==0 && res_d.data.data){
787 if (t.goods_num > store_count) { 787 if (t.goods_num > store_count) {
788 wx.showModal({ 788 wx.showModal({
789 title: '提示', 789 title: '提示',
@@ -1331,10 +1331,9 @@ Page({ @@ -1331,10 +1331,9 @@ Page({
1331 }); 1331 });
1332 }, 1332 },
1333 //跳到首页 1333 //跳到首页
1334 - goto: function(e) {  
1335 - navigateTo({  
1336 - url: '/pages/index/index/index',  
1337 - }) 1334 + goto: function(e) {
  1335 + var url='/pages/index/index/index';
  1336 + getApp().goto(url);
1338 }, 1337 },
1339 1338
1340 //---加载更多是靠这个函数---- 1339 //---加载更多是靠这个函数----
pages/cart/cart/cart.wxml
@@ -2,9 +2,17 @@ @@ -2,9 +2,17 @@
2 <template is="tabBar" data="{{tabBar}}" /> 2 <template is="tabBar" data="{{tabBar}}" />
3 --> 3 -->
4 <!-- 广告图片 --> 4 <!-- 广告图片 -->
  5 +
5 <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> 6 <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}">
6 - <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> 7 + <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image>
  8 +</navigator>
  9 +
  10 +<navigator bindtap="nav_goto" class="picture" data-url="{{ad_data.ad_weapplink}}" wx:if="{{ad_data}}">
  11 + <image mode="widthFix" class="picture" src="{{ad_data.ad_code}}"></image>
7 </navigator> 12 </navigator>
  13 +
  14 +
  15 +
8 <view class="container" wx:if="{{requestData.length>0}}"> 16 <view class="container" wx:if="{{requestData.length>0}}">
9 <!-- 购物车商品框架 --> 17 <!-- 购物车商品框架 -->
10 <view class="login-in"> 18 <view class="login-in">
pages/cart/cart/cart.wxss
@@ -22,7 +22,6 @@ page { @@ -22,7 +22,6 @@ page {
22 22
23 .picture { 23 .picture {
24 width: 100%; 24 width: 100%;
25 - height: 220rpx;  
26 } 25 }
27 26
28 .container { 27 .container {
pages/cart/cart2/cart2.js
@@ -671,7 +671,7 @@ Page({ @@ -671,7 +671,7 @@ Page({
671 ob.buynum=num; 671 ob.buynum=num;
672 ob.weight=data.gift_weight; //商品的重量 672 ob.weight=data.gift_weight; //商品的重量
673 ob.exp_sum_type=data.gift_exp_sum_type; //商品的物流计算方式 673 ob.exp_sum_type=data.gift_exp_sum_type; //商品的物流计算方式
674 - ob.uniform_exp_sum=data.uniform_exp_sum //统一运费的金额 674 + ob.uniform_exp_sum=data.gift_uniform_exp_sum //统一运费的金额
675 675
676 th.setData({buy_now_gift_goods:ob}); 676 th.setData({buy_now_gift_goods:ob});
677 } 677 }
@@ -1541,7 +1541,8 @@ Page({ @@ -1541,7 +1541,8 @@ Page({
1541 1541
1542 //如果有赠品的时候,也要计算赠品的物流费用 1542 //如果有赠品的时候,也要计算赠品的物流费用
1543 if(th.data.buy_now_gift_goods){ 1543 if(th.data.buy_now_gift_goods){
1544 - shipping_price=th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free, parseFloat(allpice)-cut_price-quan_price, rs,shipping_price,no_by_data); 1544 + shipping_price=th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,
  1545 + parseFloat(allpice)-cut_price-quan_price, rs,shipping_price,no_by_data,goods_weight,goods_piece);
1545 } 1546 }
1546 1547
1547 if(shipping_price<=0){ 1548 if(shipping_price<=0){
@@ -3161,7 +3162,7 @@ Page({ @@ -3161,7 +3162,7 @@ Page({
3161 arr.gift_original_img = get_data.goodsinfo.original_img; 3162 arr.gift_original_img = get_data.goodsinfo.original_img;
3162 arr.gift_weight = get_data.goodsinfo.weight; 3163 arr.gift_weight = get_data.goodsinfo.weight;
3163 arr.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; 3164 arr.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
3164 - arr.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; 3165 + arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
3165 arr.gift_limit_num = get_data.limit_num; 3166 arr.gift_limit_num = get_data.limit_num;
3166 arr.gift_storecount = get_data.gift_storecount; 3167 arr.gift_storecount = get_data.gift_storecount;
3167 } 3168 }
@@ -3239,7 +3240,7 @@ Page({ @@ -3239,7 +3240,7 @@ Page({
3239 }, 3240 },
3240 3241
3241 //计算立即购买赠品的物流费用 3242 //计算立即购买赠品的物流费用
3242 - get_now_gift_goods_wuliu:function (code, o_shipping_price, user_addr, gift_freight_free,allpice, rs,shipping_price,no_by_data) { 3243 + get_now_gift_goods_wuliu:function (code, o_shipping_price, user_addr, gift_freight_free,allpice, rs,shipping_price,no_by_data,goods_weight1,goods_piece1) {
3243 var good=this.data.buy_now_gift_goods; 3244 var good=this.data.buy_now_gift_goods;
3244 var goods_weight=-1, goods_piece=-1; 3245 var goods_weight=-1, goods_piece=-1;
3245 var gift_shipping_price=0; 3246 var gift_shipping_price=0;
@@ -3247,17 +3248,28 @@ Page({ @@ -3247,17 +3248,28 @@ Page({
3247 switch (good['exp_sum_type']) { 3248 switch (good['exp_sum_type']) {
3248 case 1: 3249 case 1:
3249 //统一运费 3250 //统一运费
3250 - gift_shipping_price += good['uniform_exp_sum']; break; 3251 + gift_shipping_price += good['uniform_exp_sum'];
  3252 + gift_shipping_price+=o_shipping_price;
  3253 + break;
3251 case 2: 3254 case 2:
3252 if (goods_weight < 0) goods_weight = 0; 3255 if (goods_weight < 0) goods_weight = 0;
3253 //累积商品重量 每种商品的重量 * 数量 3256 //累积商品重量 每种商品的重量 * 数量
3254 - goods_weight += good['weight'] * good['buynum'];break; 3257 + goods_weight += good['weight'] * good['buynum'];
  3258 + if(goods_weight1>0){
  3259 + goods_weight+=goods_weight1;
  3260 + }
  3261 + break;
3255 case 3: 3262 case 3:
3256 if (goods_piece < 0) goods_piece = 0; 3263 if (goods_piece < 0) goods_piece = 0;
3257 //累积商品数量 3264 //累积商品数量
3258 - goods_piece += good['buynum']; break; 3265 + goods_piece += good['buynum'];
  3266 + if(goods_piece1){
  3267 + goods_piece+=goods_piece1;
  3268 + }
  3269 + break;
3259 } 3270 }
3260 - 3271 +
  3272 +
3261 //如果有设置不包邮区域的时候 3273 //如果有设置不包邮区域的时候
3262 if(no_by_data && no_by_data.region_list){ 3274 if(no_by_data && no_by_data.region_list){
3263 if(th.check_by_area(no_by_data.region_list)){ 3275 if(th.check_by_area(no_by_data.region_list)){
@@ -3272,10 +3284,11 @@ Page({ @@ -3272,10 +3284,11 @@ Page({
3272 //th.data.is_no_by[th.data.bn_pick]=1; 3284 //th.data.is_no_by[th.data.bn_pick]=1;
3273 } 3285 }
3274 } 3286 }
  3287 +
3275 var t_shipping_price= 3288 var t_shipping_price=
3276 this.calculatewuliu(code, gift_shipping_price, goods_weight, 3289 this.calculatewuliu(code, gift_shipping_price, goods_weight,
3277 goods_piece, user_addr, gift_freight_free, allpice, rs); 3290 goods_piece, user_addr, gift_freight_free, allpice, rs);
3278 - return t_shipping_price+shipping_price; 3291 + return t_shipping_price;
3279 3292
3280 }, 3293 },
3281 3294
pages/cart/cart_wk/cart_wk.js
@@ -551,6 +551,7 @@ Page({ @@ -551,6 +551,7 @@ Page({
551 551
552 //------调起支付框-------- 552 //------调起支付框--------
553 weixinPay: function(n, success,fail) { 553 weixinPay: function(n, success,fail) {
  554 + if(!n) return false;
554 var th=this; 555 var th=this;
555 wx.requestPayment({ 556 wx.requestPayment({
556 timeStamp: String(n.timeStamp), 557 timeStamp: String(n.timeStamp),
pages/error/error.js
@@ -6,7 +6,8 @@ Page({ @@ -6,7 +6,8 @@ Page({
6 msg:"", 6 msg:"",
7 }, 7 },
8 8
9 - onLoad:function(t){ 9 + onLoad:function(t){
  10 + getApp().err_going=1;
10 var th=this,app = getApp(); 11 var th=this,app = getApp();
11 app.getConfig(function(e){ 12 app.getConfig(function(e){
12 th.setData({ store:e,msg:t.msg}); 13 th.setData({ store:e,msg:t.msg});
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -104,9 +104,12 @@ Page({ @@ -104,9 +104,12 @@ Page({
104 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; 104 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
105 getApp().request.json_post(url, json, 105 getApp().request.json_post(url, json,
106 function(res) { 106 function(res) {
107 - if (res.data.code == 0) {  
108 - var order_sn = res.data.data.orderSn;  
109 - res = res.data.data.result; 107 + if (res.data.code == 0 && res.data.data) {
  108 +
  109 + var order_sn = res.data.data.orderSn;
  110 + res = res.data.data.result;
  111 + if(!res) return false;
  112 +
110 var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; 113 var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
111 wx.requestPayment({ 114 wx.requestPayment({
112 timeStamp: String(res.timeStamp), 115 timeStamp: String(res.timeStamp),
@@ -118,7 +121,7 @@ Page({ @@ -118,7 +121,7 @@ Page({
118 getApp().goto(url); 121 getApp().goto(url);
119 }, 122 },
120 fail: function(res) { 123 fail: function(res) {
121 - getApp().my_confirm("取消支付", 0, th); 124 + getApp().my_warnning("取消支付", 0, th);
122 } 125 }
123 }); 126 });
124 } else { 127 } else {
pages/giftpack/giftpacklist/giftpacklist.js
@@ -113,6 +113,9 @@ Page({ @@ -113,6 +113,9 @@ Page({
113 function(res) { 113 function(res) {
114 if (res.data.code == 0) { 114 if (res.data.code == 0) {
115 var res = res.data.data; 115 var res = res.data.data;
  116 + if(!res) return false;
  117 + if(!res.result) return false;
  118 +
116 var order_sn = res.orderSn; 119 var order_sn = res.orderSn;
117 var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; 120 var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
118 wx.requestPayment({ 121 wx.requestPayment({
pages/goods/goodsInfo/goodsInfo.js
@@ -1587,11 +1587,10 @@ Page({ @@ -1587,11 +1587,10 @@ Page({
1587 th.setData({goodsInputNum:redis_num}) 1587 th.setData({goodsInputNum:redis_num})
1588 return false; 1588 return false;
1589 } 1589 }
1590 -  
1591 } 1590 }
1592 -  
1593 var e = th.data.sele_g.store_count; 1591 var e = th.data.sele_g.store_count;
1594 - if(th.data.sales_rules==2){ 1592 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1593 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
1595 if(!th.data.def_pick_store){ 1594 if(!th.data.def_pick_store){
1596 wx.showModal({ title: '请选择门店', }); 1595 wx.showModal({ title: '请选择门店', });
1597 return false; 1596 return false;
@@ -1599,7 +1598,7 @@ Page({ @@ -1599,7 +1598,7 @@ Page({
1599 e=th.data.def_pick_store.CanOutQty; 1598 e=th.data.def_pick_store.CanOutQty;
1600 } 1599 }
1601 } 1600 }
1602 - 1601 + if(!e) e=0;
1603 //库存不足,不增加 1602 //库存不足,不增加
1604 if(e<t){ wx.showModal({ title: '库存不足', }); 1603 if(e<t){ wx.showModal({ title: '库存不足', });
1605 if(e<0) e=0; 1604 if(e<0) e=0;
@@ -1669,7 +1668,8 @@ Page({ @@ -1669,7 +1668,8 @@ Page({
1669 } 1668 }
1670 1669
1671 var e = th.data.sele_g.store_count; 1670 var e = th.data.sele_g.store_count;
1672 - if(th.data.sales_rules==2){ 1671 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1672 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
1673 if(!th.data.def_pick_store){ 1673 if(!th.data.def_pick_store){
1674 wx.showModal({ title: '请选择门店', }); 1674 wx.showModal({ title: '请选择门店', });
1675 return false; 1675 return false;
@@ -1677,7 +1677,7 @@ Page({ @@ -1677,7 +1677,7 @@ Page({
1677 e=th.data.def_pick_store.CanOutQty; 1677 e=th.data.def_pick_store.CanOutQty;
1678 } 1678 }
1679 } 1679 }
1680 - 1680 + if(!e) e=0;
1681 //库存不足,不增加 1681 //库存不足,不增加
1682 if(e<t){ wx.showModal({ title: '库存不足', }); 1682 if(e<t){ wx.showModal({ title: '库存不足', });
1683 if(e<0) e=0; 1683 if(e<0) e=0;
@@ -3228,7 +3228,7 @@ Page({ @@ -3228,7 +3228,7 @@ Page({
3228 openSpecModel_pt: function(e) { 3228 openSpecModel_pt: function(e) {
3229 3229
3230 3230
3231 - this.setData({ open_ind_store: 4});//拼团直接给4 3231 + this.setData({ open_ind_store: 4,goodsInputNum:1});//拼团直接给4
3232 3232
3233 3233
3234 //--先判断会员状态-- 3234 //--先判断会员状态--
@@ -5137,7 +5137,7 @@ Page({ @@ -5137,7 +5137,7 @@ Page({
5137 //-- 积分购 -- 5137 //-- 积分购 --
5138 go_pay_integral:function(){ 5138 go_pay_integral:function(){
5139 this.get_sto(0) 5139 this.get_sto(0)
5140 - this.setData({openSpecModal_inte:1}); 5140 + this.setData({openSpecModal_inte:1,goodsInputNum:1});
5141 }, 5141 },
5142 //-- 积分购普通购买 -- 5142 //-- 积分购普通购买 --
5143 go_pay_integral_normal:function(){ 5143 go_pay_integral_normal:function(){
pages/index/index/full_screen.js 0 → 100644
  1 + module.exports = {
  2 + //判断要不要显示全屏广告
  3 + get_the_full_screen(th){
  4 + var stoid=getApp().globalData.setting.stoid;
  5 + if(th.data.full_ad) {
  6 + return false;
  7 + }
  8 + //获取全屏的广告
  9 + getApp().promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + stoid,{
  10 + data: { enabled: 1 }
  11 + }).then(res=>{
  12 + //判断是不是有全屏广告
  13 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  14 + th.setData({
  15 + is_full_screen_show:1,
  16 + full_ad:res.data.data.pageData[0],
  17 + })
  18 + //--定时关闭--
  19 + th.data.full_screen=setInterval(function(){
  20 + if(!th.data.sec_show) {
  21 + clearInterval(th.data.full_screen);
  22 + th.close_full_screen();
  23 + return false;
  24 + }
  25 + th.data.sec_show--;
  26 + th.setData({sec_show:th.data.sec_show});
  27 + },1000)
  28 + }
  29 + })
  30 + }
  31 +}
0 \ No newline at end of file 32 \ No newline at end of file
pages/index/index/index.js
@@ -15,6 +15,7 @@ var regeneratorRuntime = require(&#39;../../../utils/runtime.js&#39;); @@ -15,6 +15,7 @@ var regeneratorRuntime = require(&#39;../../../utils/runtime.js&#39;);
15 var api = require('../../../api/api.js'); 15 var api = require('../../../api/api.js');
16 var d = getApp().globalData; 16 var d = getApp().globalData;
17 17
  18 +var full_screen = require('full_screen.js');
18 19
19 Page({ 20 Page({
20 data: { 21 data: {
@@ -75,18 +76,82 @@ Page({ @@ -75,18 +76,82 @@ Page({
75 76
76 showHongbao: false, 77 showHongbao: false,
77 showHongbaoSmall: false, 78 showHongbaoSmall: false,
78 - 79 +
  80 + is_full_screen_show:0, //全屏显示
  81 + sec_show:3, //倒计时的秒数
  82 + full_ad:null, //全屏广告
  83 + full_screen:0, //全屏广告
  84 +
79 }, 85 },
80 86
81 onLoad: async function(tt) { 87 onLoad: async function(tt) {
82 console.log("进入首页-------------"); 88 console.log("进入首页-------------");
83 - console.log(tt);  
84 - 89 + console.log(tt);
85 var th = this; 90 var th = this;
86 var first_leader=tt.first_leader; 91 var first_leader=tt.first_leader;
87 if(!first_leader && tt.scene){ 92 if(!first_leader && tt.scene){
88 first_leader= decodeURIComponent(tt.scene); 93 first_leader= decodeURIComponent(tt.scene);
89 } 94 }
  95 +
  96 + getApp().getConfig(function(e){
  97 + //--首页的问题--
  98 + if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {
  99 + wx.setNavigationBarTitle({
  100 + title: getApp().globalData.config.store_name,
  101 + });
  102 + } else {
  103 + wx.setNavigationBarTitle({
  104 + title: getApp().globalData.setting.appName,
  105 + });
  106 + };
  107 + });
  108 +
  109 +
  110 + var th = this;
  111 +
  112 + getApp().getConfig2(function(config2){
  113 + if(config2 && config2.is_overdue==1){
  114 + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{
  115 + var o=res;
  116 + if (o.data.code == 0) {
  117 + var ob = { isout: 0, isbuy: 1 };
  118 + var arr = o.data.data.pageData;
  119 + var isbuy = 0;
  120 + //----如果数组不为空----
  121 + if (arr.length > 0) {
  122 + arr.forEach(function (val, ind) {
  123 + if (val.is_sy == 0 && val.type == 5) {
  124 + isbuy = 1;
  125 + var now = ut.gettimestamp();
  126 + if (now > val.end_time) ob.isout = 1;
  127 + return false;
  128 + }
  129 + })
  130 + }
  131 + ob.isbuy = isbuy;
  132 +
  133 + var pages = getCurrentPages(); //获取加载的页面
  134 + var currentPage = pages[pages.length - 1]; //获取当前页面的对象
  135 +
  136 + console.log("当前路由");
  137 + console.log(currentPage.route);
  138 +
  139 +
  140 + th.setappdata(ob);
  141 +
  142 + if(ob.isbuy && !ob.isout){
  143 + th.onload_init();
  144 + }
  145 + }else{
  146 + th.onload_init();
  147 + }
  148 + })
  149 + }
  150 +
  151 + else{
  152 + th.onload_init();
  153 + }
  154 + })
90 155
91 if(first_leader){ 156 if(first_leader){
92 //-- user_id代过来免登录 -- 157 //-- user_id代过来免登录 --
@@ -97,7 +162,7 @@ Page({ @@ -97,7 +162,7 @@ Page({
97 getApp().globalData.guide_id=res.data.data.id; 162 getApp().globalData.guide_id=res.data.data.id;
98 } 163 }
99 }) 164 })
100 - } 165 + }
101 166
102 // 判断是否有红包活动 167 // 判断是否有红包活动
103 getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/'+getApp().globalData.setting.stoid, { 168 getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/'+getApp().globalData.setting.stoid, {
@@ -144,72 +209,74 @@ Page({ @@ -144,72 +209,74 @@ Page({
144 //getApp().globalData.url=th.data.url 209 //getApp().globalData.url=th.data.url
145 //t.editTabBar(th,o.stoid,th.data.url); 210 //t.editTabBar(th,o.stoid,th.data.url);
146 211
147 - await this.init_load();  
148 -  
149 -  
150 - //显示的时候要开启计时器  
151 - this.data.is_timer = 1;  
152 - //如果是自定义模板  
153 - if (this.data.isTemplate) {  
154 - //---先获取会员---  
155 - t.getUserFir(function() {  
156 - th.is_festival();  
157 - var new_nav = th.data.new_nav;  
158 - if (new_nav == "") {  
159 - th.is_new();  
160 - }  
161 - setTimeout(function () {  
162 - if (getApp().globalData.user_id) getApp().requestCardNum(th);  
163 - },500)  
164 -  
165 - });  
166 - } else {  
167 - await this.init_fir();  
168 - wx.setNavigationBarColor({  
169 - frontColor: '#ffffff', // 必写项  
170 - backgroundColor: '#ff7295', // 必写项  
171 - })  
172 - }  
173 -  
174 - //--正再拼团中的处理--  
175 - var url = "/api/weshop/order/pageTuan?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1"  
176 - await getApp().request.promiseGet(url, {}).then(res => {  
177 - if (res.data.code == 0 && res.data.data && res.data.data.pageData) {  
178 - th.data.pt_timer_arr = res.data.data.pageData;  
179 - }  
180 - })  
181 - if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) {  
182 - for (var i in th.data.pt_timer_arr) {  
183 - var p_item = th.data.pt_timer_arr[i];  
184 - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {  
185 - 1: 1  
186 - }).then(res => {  
187 - th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic;  
188 - th.data.pt_timer_arr[i].nickname = res.data.data.nickname;  
189 - })  
190 - }  
191 - th.Interval_pt();  
192 - }  
193 -  
194 - //---处理正在6个分类----  
195 - await getApp().request.promiseGet("/api/weshop/goodscategory/page", {  
196 - data: {  
197 - store_id: os.stoid,  
198 - pageSize: 5,  
199 - is_show: 1,  
200 - level:1  
201 - }  
202 - }).then(res => {  
203 - if (res.data.data) {  
204 - var gd_category = res.data.data.pageData;  
205 - th.setData({  
206 - gd_category: gd_category  
207 - });  
208 - }  
209 - })  
210 -  
211 -  
212 }, 212 },
  213 +
  214 + async onload_init(){
  215 + var th=this;
  216 + await this.init_load();
  217 + //显示的时候要开启计时器
  218 + this.data.is_timer = 1;
  219 + //如果是自定义模板
  220 + if (this.data.isTemplate) {
  221 + //---先获取会员---
  222 + t.getUserFir(function() {
  223 + th.is_festival();
  224 + var new_nav = th.data.new_nav;
  225 + if (new_nav == "") {
  226 + th.is_new();
  227 + }
  228 + setTimeout(function () {
  229 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  230 + },500)
  231 +
  232 + });
  233 + } else {
  234 + await this.init_fir();
  235 + wx.setNavigationBarColor({
  236 + frontColor: '#ffffff', // 必写项
  237 + backgroundColor: '#ff7295', // 必写项
  238 + })
  239 + }
  240 +
  241 + //--正再拼团中的处理--
  242 + var url = "/api/weshop/order/pageTuan?pt_status=2&is_pt=1&store_id=" + os.stoid + "&pageSize=6&page=1"
  243 + await getApp().request.promiseGet(url, {}).then(res => {
  244 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  245 + th.data.pt_timer_arr = res.data.data.pageData;
  246 + }
  247 + })
  248 + if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) {
  249 + for (var i in th.data.pt_timer_arr) {
  250 + var p_item = th.data.pt_timer_arr[i];
  251 + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {
  252 + 1: 1
  253 + }).then(res => {
  254 + th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic;
  255 + th.data.pt_timer_arr[i].nickname = res.data.data.nickname;
  256 + })
  257 + }
  258 + th.Interval_pt();
  259 + }
  260 +
  261 + //---处理正在6个分类----
  262 + await getApp().request.promiseGet("/api/weshop/goodscategory/page", {
  263 + data: {
  264 + store_id: os.stoid,
  265 + pageSize: 5,
  266 + is_show: 1,
  267 + level:1
  268 + }
  269 + }).then(res => {
  270 + if (res.data.data) {
  271 + var gd_category = res.data.data.pageData;
  272 + th.setData({
  273 + gd_category: gd_category
  274 + });
  275 + }
  276 + })
  277 + },
  278 +
  279 +
213 //关闭新用户领取广告 280 //关闭新用户领取广告
214 close_disgraceful: function() { 281 close_disgraceful: function() {
215 var th = this; 282 var th = this;
@@ -255,9 +322,8 @@ Page({ @@ -255,9 +322,8 @@ Page({
255 if(!userInfo || !userInfo.user_id) userInfo=null; 322 if(!userInfo || !userInfo.user_id) userInfo=null;
256 //有加载过一次首页,就显示 323 //有加载过一次首页,就显示
257 if(show || userInfo || getApp().globalData.user_id){ 324 if(show || userInfo || getApp().globalData.user_id){
258 - setTimeout(function(){  
259 - var full_screen = th.selectComponent("#full_screen"); //组件的id  
260 - full_screen.get_the_full_screen(); 325 + setTimeout(function(){
  326 + full_screen.get_the_full_screen(th);
261 },800) 327 },800)
262 //动画效果 328 //动画效果
263 if(!th.data.f_hidden){ 329 if(!th.data.f_hidden){
@@ -282,25 +348,18 @@ Page({ @@ -282,25 +348,18 @@ Page({
282 this.data.is_timer = 0; 348 this.data.is_timer = 0;
283 clearInterval(this.data.pt_timer); 349 clearInterval(this.data.pt_timer);
284 clearInterval(this.data.w_holiday_pop); 350 clearInterval(this.data.w_holiday_pop);
  351 + clearInterval(this.data.full_screen);
  352 +
285 this.data.w_holiday_pop=0; 353 this.data.w_holiday_pop=0;
286 for(var i = 1; i < 100; i++) { 354 for(var i = 1; i < 100; i++) {
287 clearInterval(i); 355 clearInterval(i);
288 } 356 }
289 357
290 -  
291 }, 358 },
292 359
293 //同步初始加载 360 //同步初始加载
294 async init_load() { 361 async init_load() {
295 - await getApp().getConfig_ays();  
296 - var th = this;  
297 - if(getApp().globalData.config2.is_overdue==1){  
298 - await getApp().get_isbuy();  
299 - this.setappdata(getApp().globalData.wxapp_buy_obj);  
300 - }  
301 -  
302 -  
303 - 362 + var th=this;
304 //因为营销版本的功能包含了自定义模板的功能,是同时的 363 //因为营销版本的功能包含了自定义模板的功能,是同时的
305 //读取全局是否有弄自定义模板 364 //读取全局是否有弄自定义模板
306 await api.get_template_fir(o.stoid).then(res => { 365 await api.get_template_fir(o.stoid).then(res => {
@@ -327,16 +386,7 @@ Page({ @@ -327,16 +386,7 @@ Page({
327 386
328 387
329 388
330 - //--首页的问题--  
331 - if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {  
332 - wx.setNavigationBarTitle({  
333 - title: getApp().globalData.config.store_name,  
334 - });  
335 - } else {  
336 - wx.setNavigationBarTitle({  
337 - title: getApp().globalData.setting.appName,  
338 - });  
339 - }; 389 +
340 390
341 391
342 392
@@ -1005,5 +1055,17 @@ Page({ @@ -1005,5 +1055,17 @@ Page({
1005 showHongbaoSmall: true, //显示抢红包小图标 1055 showHongbaoSmall: true, //显示抢红包小图标
1006 }); 1056 });
1007 }, 1057 },
  1058 +
  1059 + /*-- 全屏广告 --*/
  1060 + close_full_screen(){
  1061 + this.setData({is_full_screen_show:0,sec_show:0});
  1062 + },
  1063 + //-- 跳转到满屏广告的链接 --
  1064 + go_full_ad(){
  1065 + if(!this.data.full_ad) return false;
  1066 + if(!this.data.full_ad.ad_weapplink) return false;
  1067 + getApp().goto(this.data.full_ad.ad_weapplink);
  1068 + this.close_full_screen();
  1069 + },
1008 1070
1009 }); 1071 });
1010 \ No newline at end of file 1072 \ No newline at end of file
pages/index/index/index.json
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
18 "mvideo": "/components/diy_video/diy_video", 18 "mvideo": "/components/diy_video/diy_video",
19 "service": "/components/diy_service/diy_service", 19 "service": "/components/diy_service/diy_service",
20 "scan": "/components/diy_scan/diy_scan", 20 "scan": "/components/diy_scan/diy_scan",
21 - "full_screen": "/components/full_screen/full_screen",  
22 "store_select": "/components/diy_store_select/diy_store_select" 21 "store_select": "/components/diy_store_select/diy_store_select"
23 }, 22 },
24 "enablePullDownRefresh": false 23 "enablePullDownRefresh": false
pages/index/index/index.wxml
1 <!-- <view hidden="{{f_hidden}}" class="full_screen" style="background-color: #fff;"></view> --> 1 <!-- <view hidden="{{f_hidden}}" class="full_screen" style="background-color: #fff;"></view> -->
2 -<full_screen id="full_screen"></full_screen> 2 +<!-- <full_screen id="full_screen"></full_screen> -->
  3 +
  4 +<!-- 全屏控制 -->
  5 +<view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');">
  6 + <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view>
  7 +</view>
  8 +
3 <!--普通界面--> 9 <!--普通界面-->
4 <wxs module="filter" src="../../../utils/filter.wxs"></wxs> 10 <wxs module="filter" src="../../../utils/filter.wxs"></wxs>
5 11
@@ -106,14 +112,12 @@ @@ -106,14 +112,12 @@
106 </view> 112 </view>
107 </view> 113 </view>
108 114
109 -  
110 -  
111 -  
112 - <!---大分类---> 115 + <!-- 大分类 -->
113 <view class="flex-center-around"> 116 <view class="flex-center-around">
114 <view wx:for="{{gd_category}}" bindtap="go_cate2" data-cid="{{item.id}}" data-pid="0"> 117 <view wx:for="{{gd_category}}" bindtap="go_cate2" data-cid="{{item.id}}" data-pid="0">
115 <view class="circle xc-class-frame t-c"> 118 <view class="circle xc-class-frame t-c">
116 - <image class="xc-class-img" src="{{item.icoimg==null||item.icoimg==''?url+item.icon:item.icoimg}}" binderror="bind_bnerr_icon" data-err="gd_category[{{index}}].icon"></image> 119 + <image class="xc-class-img" src="{{item.icoimg==null||item.icoimg==''?(item.image?url+item.image:url+'/miniapp/images/no_cate_def.png'):item.icoimg}}"
  120 + binderror="bind_bnerr_icon" data-err="gd_category[{{index}}].icon"></image>
117 <view class="fs24 gonju ellipsis-1">{{item.name}}</view> 121 <view class="fs24 gonju ellipsis-1">{{item.name}}</view>
118 </view> 122 </view>
119 </view> 123 </view>
pages/index/index/index.wxss
@@ -977,3 +977,9 @@ page { @@ -977,3 +977,9 @@ page {
977 background-size: 100% 100%; 977 background-size: 100% 100%;
978 background-repeat: no-repeat; 978 background-repeat: no-repeat;
979 } 979 }
  980 +.skip_box{
  981 + float: right; margin-top: 10rpx; margin-right: 10rpx;
  982 + background-color: gainsboro; width: 120rpx;
  983 + height: 48rpx; font-size: 28rpx; line-height: 48rpx;
  984 + text-align: center; border-radius: 20rpx;
  985 + }
pages/team/team_show/team_show.js
@@ -721,11 +721,12 @@ Page({ @@ -721,11 +721,12 @@ Page({
721 go_pay:function () { 721 go_pay:function () {
722 var th=this; 722 var th=this;
723 var def_pick_store=this.data.def_pick_store; 723 var def_pick_store=this.data.def_pick_store;
724 - if(def_pick_store) { 724 + if(def_pick_store && def_pick_store.pickup_id) {
725 th.data.pick_id=def_pick_store.pickup_id; //选择门店 725 th.data.pick_id=def_pick_store.pickup_id; //选择门店
726 th.data.end_name=def_pick_store.pickup_name; 726 th.data.end_name=def_pick_store.pickup_name;
727 } 727 }
728 - if (th.data.pick_id == 0) return s.my_warnning("请选择门店", 0, th); 728 + if (!th.data.pick_id) return s.my_warnning("请选择门店", 0, th);
  729 + if (th.data.pick_id==0) return s.my_warnning("请选择门店", 0, th);
729 730
730 //----判断起购数---- 731 //----判断起购数----
731 var qnum=parseFloat(th.data.teamlist.minbuynum); 732 var qnum=parseFloat(th.data.teamlist.minbuynum);
pages/team/team_show/team_show.wxml
@@ -215,26 +215,29 @@ @@ -215,26 +215,29 @@
215 <view style="margin-top: 20rpx"> 215 <view style="margin-top: 20rpx">
216 <view class="flex-space-between address ai_end xc-width "> 216 <view class="flex-space-between address ai_end xc-width ">
217 217
218 - <view class="flex ai_end" wx:if="{{def_pick_store}}"> 218 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
219 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> 219 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
220 220
221 <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> 221 <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}">
222 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} 222 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
223 </view> 223 </view>
224 </view> 224 </view>
225 - <view class="red-co fs28" bindtap="choice_store" wx:if="{{def_pick_store}}">  
226 - 更多门店  
227 - <text class="right-arrow"></text>  
228 - </view> 225 +
  226 +
229 <view class="flex" bindtap="choice_store" wx:else> 227 <view class="flex" bindtap="choice_store" wx:else>
230 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> 228 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
231 <view class="fs28 xc-ash-9f">选择门店</view> 229 <view class="fs28 xc-ash-9f">选择门店</view>
232 </view> 230 </view>
  231 +
  232 + <view class="red-co fs28" bindtap="choice_store">
  233 + 更多门店
  234 + <text class="right-arrow"></text>
  235 + </view>
233 236
234 237
235 </view> 238 </view>
236 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> 239 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>
237 - <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store}}">地址:5{{def_pick_store.fulladdress}}</view> 240 + <view class="fs24 xc-ash-9f xc-distance-top " wx:elif="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
238 241
239 </view> 242 </view>
240 <!-- 商品的属性项目 --> 243 <!-- 商品的属性项目 -->
pages/togoin/togoin.js
@@ -10,21 +10,41 @@ Page({ @@ -10,21 +10,41 @@ Page({
10 imghots: os.imghost, 10 imghots: os.imghost,
11 store_logo:'', 11 store_logo:'',
12 first_leader:'', //-- 邀请人 -- 12 first_leader:'', //-- 邀请人 --
  13 + config2:null,
13 }, 14 },
14 onLoad: function (options) { 15 onLoad: function (options) {
  16 + if (wx.getUserProfile) {
  17 + this.setData({
  18 + canIUseGetUserProfile: true
  19 + })
  20 + }
  21 +
15 getApp().globalData.isLoad_ad=1; 22 getApp().globalData.isLoad_ad=1;
16 //--判断是否有接受到邀请人的ID-- 23 //--判断是否有接受到邀请人的ID--
17 if(options.first_leader){ 24 if(options.first_leader){
18 - this.setData({first_leader:options.first_leader}); 25 + this.setData({first_leader:options.first_leader});
19 }else if(getApp().globalData.first_leader){ 26 }else if(getApp().globalData.first_leader){
20 - this.setData({first_leader:getApp().globalData.first_leader});  
21 - 27 + this.setData({first_leader:getApp().globalData.first_leader});
22 } 28 }
23 var th=this; 29 var th=this;
24 app.getConfig(function (e) { 30 app.getConfig(function (e) {
25 var logo=th.data.imghots+e.store_logo; 31 var logo=th.data.imghots+e.store_logo;
26 th.setData({ store: e,store_logo:logo}); 32 th.setData({ store: e,store_logo:logo});
27 - }) 33 + })
  34 +
  35 + //判断注册的条件
  36 + app.getConfig2(function (e) {
  37 + if(e.reg_type==1){
  38 + var arr=JSON.parse(e.reg_info);
  39 + if(arr['name_state']==1) th.data.name_need_go=1;
  40 + if(arr['birthday_state']==1) th.data.birth_need_go=1;
  41 + if(arr['idcard_state']==1) th.data.idcard_need_go=1;
  42 + if(arr['address_state']==1) th.data.address_need_go=1;
  43 + if(arr['pick_state']==1) th.data.pick_need_go=1;
  44 + if(arr['sex_state']==1) th.data.sex_need_go=1;
  45 + if(arr['introducer_state']==1) th.data.introducer_need_go=1;
  46 + }
  47 + },1)
28 }, 48 },
29 //绑定手机号 49 //绑定手机号
30 getphone:function (e) { 50 getphone:function (e) {
@@ -38,8 +58,7 @@ Page({ @@ -38,8 +58,7 @@ Page({
38 var th=this; 58 var th=this;
39 var sessionKey = getApp().globalData.sessionKey; 59 var sessionKey = getApp().globalData.sessionKey;
40 var openid = getApp().globalData.openid; 60 var openid = getApp().globalData.openid;
41 - var r=getApp().globalData.getu;  
42 - 61 + var r=getApp().globalData.getu;
43 th.save_the_data(r,e,sessionKey,openid) 62 th.save_the_data(r,e,sessionKey,openid)
44 }, 63 },
45 64
@@ -92,6 +111,7 @@ Page({ @@ -92,6 +111,7 @@ Page({
92 }); 111 });
93 } 112 }
94 }) 113 })
  114 +
95 }) 115 })
96 }, 116 },
97 117
@@ -163,11 +183,52 @@ Page({ @@ -163,11 +183,52 @@ Page({
163 } else { 183 } else {
164 return app.showWarning("授权登入失败!"+e.data.msg); 184 return app.showWarning("授权登入失败!"+e.data.msg);
165 } 185 }
166 -  
167 - wx.setStorageSync("userinfo",e.data.data); 186 +
  187 + var need_go=0;
  188 + var tuser=e.data.data;
  189 + wx.setStorageSync("userinfo",e.data.data);
168 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); 190 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
169 - wx.navigateBack({ delta: 1})  
170 - 191 + //获取一下线下的真实资料
  192 + let url3 = '/api/weshop/users/getERPUser/';
  193 + url3 += os.stoid + "/" +tuser.user_id;
  194 + getApp().promiseGet(url3,{}).then(res=>{
  195 +
  196 + if(res.data.code == 0) {
  197 + let t_user = res.data.data;
  198 + //如果有需要完善的信息没有完善,就需要跳转
  199 + if (!t_user['vipname'] && th.data.name_need_go) {
  200 + need_go = 1;
  201 + }
  202 + if (!t_user['birthday'] && th.data.birth_need_go) {
  203 + need_go = 1;
  204 + }
  205 + if (!t_user['idcard'] && th.data.idcard_need_go) {
  206 + need_go = 1;
  207 + }
  208 + if (!t_user['address'] && th.data.address_need_go) {
  209 + need_go = 1;
  210 + }
  211 + if (!t_user['pickup_id'] && th.data.pick_need_go) {
  212 + need_go = 1;
  213 + }
  214 + if (!t_user['sex'] && th.data.sex_need_go) {
  215 + need_go = 1;
  216 + }
  217 + if (!t_user['fromuser_id'] && th.data.introducer_need_go) {
  218 + need_go = 1;
  219 + }
  220 +
  221 + if (need_go) {
  222 + getApp().goto("/packageA/pages/profile/profile");
  223 + } else {
  224 + wx.navigateBack({delta: 1})
  225 + }
  226 + }
  227 + })
  228 +
  229 +
  230 +
  231 +
171 }, 232 },
172 failStatus: function (t) { 233 failStatus: function (t) {
173 return app.my_warnning("授权登入失败,请稍后再试!", 0, that); 234 return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
@@ -183,6 +244,63 @@ Page({ @@ -183,6 +244,63 @@ Page({
183 var _errObj = {}; 244 var _errObj = {};
184 _errObj[_errImg] = this.data.imghots+"/miniapp/images/logo.png"; 245 _errObj[_errImg] = this.data.imghots+"/miniapp/images/logo.png";
185 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 246 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  247 + },
  248 +
  249 + //-- 会员授权 --
  250 + bindUserInfo: function(ee) {
  251 + var that = this;
  252 + var user=ee.detail.userInfo;
  253 + //此处授权得到userInfo
  254 + getApp().globalData.getu = user;
  255 +
  256 + //--拿下code--
  257 + wx.login({
  258 + success: function (o) {
  259 + var dd = {
  260 + js_code:o.code,
  261 + store_id: os.stoid,
  262 + nickname: app.clear_word(app.globalData.getu.nickName),
  263 + head_pic: app.clear_word(app.globalData.getu.avatarUrl)
  264 + };
  265 + //-- 导购会员ID --
  266 + if(getApp().globalData.guide_id){
  267 + dd.guide_id=getApp().globalData.guide_id;
  268 + }
  269 +
  270 + getApp().request.get("/api/weshop/users/openidandkey", {
  271 + data: dd,
  272 + success: function (e) {
  273 + if(e.data.code==0){
  274 + that.setData({user:user})
  275 + //如果有会员的话,没有sessionKey
  276 + if(!e.data.data.sessionKey){
  277 + getApp().showWarning("登录成功");
  278 + getApp().globalData.userInfo=e.data.data;
  279 + getApp().globalData.user_id=e.data.data.user_id;
  280 + getApp().globalData.openid = e.data.data.weapp_openid;
  281 + //把会员的信息存在内存
  282 + wx.setStorageSync("userinfo",e.data.data);
  283 +
  284 + setTimeout(function () {
  285 + wx.navigateBack({ delta: 1}) //返回上一页
  286 + },1000)
  287 + }else{
  288 + getApp().globalData.sessionKey=e.data.data.sessionKey;
  289 + getApp().globalData.openid=e.data.data.openid;
  290 + that.setData({show_bind:1});
  291 + }
  292 + }else{
  293 + getApp().confirmBox(e.data.msg);
  294 + }
  295 + }
  296 + });
  297 + }
  298 + })
  299 +
  300 +
186 } 301 }
187 - 302 +
  303 +
  304 +
  305 +
188 }) 306 })
pages/togoin/togoin.wxml
@@ -14,13 +14,27 @@ @@ -14,13 +14,27 @@
14 <!-- 登录按钮 --> 14 <!-- 登录按钮 -->
15 <view> 15 <view>
16 <view class="phones"> 16 <view class="phones">
17 - <!-- 授权获取基础信息 -->  
18 - <button hidden="{{user}}" class="getPhoneNumber" bindtap="bindGetUserInfo">  
19 - <view class="flex flex-center2 ali-c">  
20 - <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>  
21 - <view>微信账号快捷登录</view>  
22 - </view>  
23 - </button> 17 +
  18 + <!-- 授权获取基础信息 -->
  19 + <block wx:if="{{canIUseGetUserProfile}}">
  20 + <button hidden="{{user}}" class="getPhoneNumber" bindtap="bindGetUserInfo">
  21 + <view class="flex flex-center ali-c">
  22 + <image class="we_chat" src="/images/we_chat.png"></image>
  23 + <view>微信账号快捷登录</view>
  24 + </view>
  25 + </button>
  26 + </block>
  27 +
  28 + <block wx:else>
  29 + <!-- 授权获取基础信息 -->
  30 + <button hidden="{{user}}" class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindUserInfo">
  31 + <view class="flex flex-center ali-c">
  32 + <image class="we_chat" src="/images/we_chat.png"></image>
  33 + <view>微信账号快捷登录</view>
  34 + </view>
  35 + </button>
  36 + </block>
  37 +
24 <!-- 点击显示绑定手机的对话框 --> 38 <!-- 点击显示绑定手机的对话框 -->
25 <button hidden="{{!user}}" class="getPhoneNumber" bindtap="show_bind_mobile"> 39 <button hidden="{{!user}}" class="getPhoneNumber" bindtap="show_bind_mobile">
26 <view class="flex flex-center2 ali-c" > 40 <view class="flex flex-center2 ali-c" >
@@ -51,5 +65,5 @@ @@ -51,5 +65,5 @@
51 </view> 65 </view>
52 </view> 66 </view>
53 </view> 67 </view>
54 -  
55 <warn id="warn"></warn> 68 <warn id="warn"></warn>
  69 +
pages/user/coupons/coupons.wxml
@@ -22,9 +22,14 @@ @@ -22,9 +22,14 @@
22 22
23 <view class='noCoupons' wx:if='{{details.length==0 && isset}}'> 23 <view class='noCoupons' wx:if='{{details.length==0 && isset}}'>
24 <image src='{{iurl}}miniapp/images/user/wqnone.png'></image> 24 <image src='{{iurl}}miniapp/images/user/wqnone.png'></image>
25 - <view class='no_wz1'>没有微券?</view>  
26 - <view class='no_wz2'>快去兑换吧</view>  
27 - <view class='no_btn' bindtap='exchange'>立即兑换</view> 25 + <block wx:if="{{is_show_dhwz}}">
  26 + <view class='no_wz1'>没有微券?</view>
  27 + <view class='no_wz2'>快去兑换吧</view>
  28 + <view class='no_btn' bindtap='exchange'>立即兑换</view>
  29 + </block>
  30 + <block wx:else>
  31 + <view class='no_wz1'>暂无数据</view>
  32 + </block>
28 </view> 33 </view>
29 <view wx:else> 34 <view wx:else>
30 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> 35 <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail">
pages/user/deposit/prepaid/prepaid.js
@@ -159,6 +159,8 @@ Page({ @@ -159,6 +159,8 @@ Page({
159 159
160 //------调起支付框-------- 160 //------调起支付框--------
161 weixinPay: function (n, success, fail) { 161 weixinPay: function (n, success, fail) {
  162 + if(!n) return false;
  163 +
162 wx.requestPayment({ 164 wx.requestPayment({
163 timeStamp: String(n.timeStamp), 165 timeStamp: String(n.timeStamp),
164 nonceStr: n.nonceStr, 166 nonceStr: n.nonceStr,
pages/user/index/index.js
@@ -112,10 +112,33 @@ Page({ @@ -112,10 +112,33 @@ Page({
112 need_money = 0, 112 need_money = 0,
113 cur_g_num = 0; 113 cur_g_num = 0;
114 114
115 - if(getApp().globalData.config2.is_overdue==1){  
116 - //调用底部导航  
117 - getApp().get_isbuy(th.setappdata);  
118 - } 115 + getApp().getConfig2(function(config2){
  116 + if(config2 && config2.is_overdue==1){
  117 + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{
  118 + var o=res;
  119 + if (o.data.code == 0) {
  120 + var ob = { isout: 0, isbuy: 1 };
  121 + var arr = o.data.data.pageData;
  122 + var isbuy = 0;
  123 + //----如果数组不为空----
  124 + if (arr.length > 0) {
  125 + arr.forEach(function (val, ind) {
  126 + if (val.is_sy == 0 && val.type == 5) {
  127 + isbuy = 1;
  128 + var now = ut.gettimestamp();
  129 + if (now > val.end_time) ob.isout = 1;
  130 + return false;
  131 + }
  132 + })
  133 + }
  134 + ob.isbuy = isbuy;
  135 + th.setappdata(ob);
  136 + }
  137 + })
  138 + }
  139 + })
  140 +
  141 +
119 setTimeout(function () { 142 setTimeout(function () {
120 if (getApp().globalData.user_id) getApp().requestCardNum(th); 143 if (getApp().globalData.user_id) getApp().requestCardNum(th);
121 },500) 144 },500)
@@ -317,6 +340,11 @@ Page({ @@ -317,6 +340,11 @@ Page({
317 if (t_swi) t_swi = JSON.parse(t_swi) 340 if (t_swi) t_swi = JSON.parse(t_swi)
318 if(t_swi){ 341 if(t_swi){
319 th.setData({sys_switch:t_swi}); 342 th.setData({sys_switch:t_swi});
  343 +
  344 + var user_tool=[];
  345 + if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool);
  346 + th.setData({c_list:user_tool})
  347 +
320 } 348 }
321 349
322 350
@@ -345,15 +373,16 @@ Page({ @@ -345,15 +373,16 @@ Page({
345 } 373 }
346 }) 374 })
347 //th.requestRecommend(); 375 //th.requestRecommend();
348 - }  
349 - 376 + }
  377 +
  378 + /*--
350 var t_swi= getApp().globalData.config2.switch_list 379 var t_swi= getApp().globalData.config2.switch_list
351 if (t_swi){ 380 if (t_swi){
352 t_swi = JSON.parse(t_swi); 381 t_swi = JSON.parse(t_swi);
353 var user_tool=[]; 382 var user_tool=[];
354 if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool); 383 if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool);
355 th.setData({c_list:user_tool}) 384 th.setData({c_list:user_tool})
356 - } 385 + } --*/
357 386
358 387
359 var goods_list = this.selectComponent("#goods_recommend"); //组件的id 388 var goods_list = this.selectComponent("#goods_recommend"); //组件的id
@@ -704,7 +733,9 @@ Page({ @@ -704,7 +733,9 @@ Page({
704 733
705 //添加卡包 734 //添加卡包
706 addcard:function(){ 735 addcard:function(){
707 - var res=this.data.add_card_data; 736 + var res=this.data.add_card_data;
  737 + if(!res) return false;
  738 +
708 var arr = new Array(6) 739 var arr = new Array(6)
709 arr[0] = res.code; 740 arr[0] = res.code;
710 arr[1] = res.timestamp; 741 arr[1] = res.timestamp;
pages/user/integral/integral.js
@@ -283,6 +283,7 @@ Page({ @@ -283,6 +283,7 @@ Page({
283 283
284 //------调起支付框-------- 284 //------调起支付框--------
285 weixinPay: function (n, success, fail) { 285 weixinPay: function (n, success, fail) {
  286 + if(!n) return false;
286 wx.requestPayment({ 287 wx.requestPayment({
287 timeStamp: String(n.timeStamp), 288 timeStamp: String(n.timeStamp),
288 nonceStr: n.nonceStr, 289 nonceStr: n.nonceStr,
pages/user/my_service/i_service.wxml
1 <!-- 背景图片 --> 1 <!-- 背景图片 -->
2 <view catchtap="close"> 2 <view catchtap="close">
3 - <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" lazy-load="true"></image>  
4 - <!-- <view> -->  
5 - <navigator class="History fs26" url="/packageA/pages/service_record/service_record" style="left:10px;right:auto;">服务记录</navigator>  
6 - <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史预约</navigator>  
7 - <!-- </view> -->  
8 - <!-- <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史预约</navigator> --> 3 + <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" lazy-load="true"/>
  4 + <view class="flex jc_sb pd20">
  5 + <navigator class="fs26 white" url="/packageA/pages/service_record/service_record">服务记录</navigator>
  6 + <navigator class="fs26 white" url="/pages/user/my_service/hist_service">历史预约</navigator>
  7 + </view>
  8 +
9 </view> 9 </view>
10 10
11 <!-- 预约内容 --> 11 <!-- 预约内容 -->
12 <!-- 项目框架 --> 12 <!-- 项目框架 -->
13 <view class="Serviceitems" catchtap="close"> 13 <view class="Serviceitems" catchtap="close">
14 - <!-- 单个项目 -->  
15 - <view class="rel" wx:for="{{service_List}}">  
16 - <view class="abs">  
17 - <!-- 皇冠log -->  
18 - <block wx:if="{{item.BuyType==4}}">  
19 - <image class="equity_money" src="{{iurl}}/miniapp/images//yyservice/equity.png" lazy-load="true"></image>  
20 - </block>  
21 - <!-- 金钱log -->  
22 - <block wx:if="{{item.BuyType==1 || item.BuyType==2 }}">  
23 - <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/money.png" lazy-load="true"></image>  
24 - </block>  
25 - <!-- 礼包log -->  
26 - <block wx:if="{{item.BuyType==3}}">  
27 - <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/giftpackage.png" lazy-load="true"></image>  
28 - </block>  
29 - </view>  
30 - <view>  
31 - <view class="flex-center">  
32 - <image class="itemimage" src="{{item.ImageUrl==''?iurl+defimgurl:item.ImageUrl}}" lazy-load="true" data-errorimg="service_List[{{index}}].ImageUrl" binderror="bind_bnerr1" data-img="{{item.ImageUrl}}"></image>  
33 - </view>  
34 -  
35 - <view class="flex-center itemName">  
36 - <view class="fs32 Name ellipsis-1">{{item.ServiceName}}</view>  
37 - </view>  
38 -  
39 - <view class="flex-center fs24 itemCount">  
40 - <view>剩余次数:</view>  
41 - <view>{{item.ObtainTimes}}</view>  
42 - </view>  
43 -  
44 - <view class="flex-center fs24 itemEffective">  
45 - <view>有效期至</view>  
46 - <view class="Date">{{item.Validay==""?"长期有效":item.Validay}}</view>  
47 - </view>  
48 -  
49 - </view>  
50 -  
51 - <view class="flex-center fs28 functionMax">  
52 - <view class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">  
53 - <view>立即使用</view>  
54 - </view>  
55 - <!-- 可预约 -->  
56 - <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}">  
57 - <view>预约</view>  
58 - </view>  
59 - </view>  
60 - </view> 14 + <view class="flex jc_sb flex-wrap">
  15 + <!-- 单个项目 -->
  16 + <view class="rel" wx:for="{{service_List}}">
  17 + <view class="abs">
  18 + <!-- 皇冠log -->
  19 + <block wx:if="{{item.BuyType==4}}">
  20 + <image class="equity_money" src="{{iurl}}/miniapp/images//yyservice/equity.png" lazy-load="true"></image>
  21 + </block>
  22 + <!-- 金钱log -->
  23 + <block wx:if="{{item.BuyType==1 || item.BuyType==2 }}">
  24 + <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/money.png" lazy-load="true"></image>
  25 + </block>
  26 + <!-- 礼包log -->
  27 + <block wx:if="{{item.BuyType==3}}">
  28 + <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/giftpackage.png" lazy-load="true"></image>
  29 + </block>
  30 + </view>
  31 + <view>
  32 + <view class="flex-center">
  33 + <image class="itemimage" src="{{item.ImageUrl==''?iurl+defimgurl:item.ImageUrl}}" lazy-load="true" data-errorimg="service_List[{{index}}].ImageUrl" binderror="bind_bnerr1" data-img="{{item.ImageUrl}}"></image>
  34 + </view>
  35 +
  36 + <view class="flex-center itemName">
  37 + <view class="fs32 Name ellipsis-1">{{item.ServiceName}}</view>
  38 + </view>
  39 +
  40 + <view class="flex-center fs24 itemCount">
  41 + <view>剩余次数:</view>
  42 + <view>{{item.ObtainTimes}}</view>
  43 + </view>
  44 +
  45 + <view class="flex-center fs24 itemEffective">
  46 + <view>有效期至</view>
  47 + <view class="Date">{{item.Validay==""?"长期有效":item.Validay}}</view>
  48 + </view>
  49 +
  50 + </view>
  51 +
  52 + <view class="flex-center fs28 functionMax">
  53 + <view class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">
  54 + <view>立即使用</view>
  55 + </view>
  56 + <!-- 可预约 -->
  57 + <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}">
  58 + <view>预约</view>
  59 + </view>
  60 + </view>
  61 + </view>
  62 + </view>
  63 +
  64 +
  65 +<view class="fs26 t-c" style="line-height: 80rpx;">选择更多服务卡项,<text class="ctb" data-url="/packageA/pages/cardList/cardList" bindtap="goto">立即购买!</text></view>
61 <!-- 没有数据 --> 66 <!-- 没有数据 -->
62 <!-- 加载完毕并且数据大于=页大小 --> 67 <!-- 加载完毕并且数据大于=页大小 -->
63 <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}"> 68 <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}">
64 <view class="Line"></view> 69 <view class="Line"></view>
65 - <view class="end fs26 xc-black">到底了</view> 70 + <view class="end fs24 xc-black">到底了</view>
66 <view class="Line"></view> 71 <view class="Line"></view>
67 </view> 72 </view>
68 <!-- <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}">选择更多服务卡项,</view> --> 73 <!-- <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}">选择更多服务卡项,</view> -->
69 </view> 74 </view>
  75 +
70 <!-- 无服务项目 --> 76 <!-- 无服务项目 -->
71 <view wx:if="{{service_List.length<1 && is_service_read}}"> 77 <view wx:if="{{service_List.length<1 && is_service_read}}">
72 <!-- 遮住 --> 78 <!-- 遮住 -->
pages/user/my_service/i_service.wxss
@@ -8,9 +8,8 @@ page { @@ -8,9 +8,8 @@ page {
8 position: absolute; 8 position: absolute;
9 top: 0rpx; 9 top: 0rpx;
10 left: 0rpx; 10 left: 0rpx;
11 - z-index: 0; 11 + z-index: -1;
12 width: 100%; 12 width: 100%;
13 - /* height: 100%; */  
14 } 13 }
15 14
16 /* 历史服务定位 */ 15 /* 历史服务定位 */
@@ -25,11 +24,11 @@ page { @@ -25,11 +24,11 @@ page {
25 24
26 .rel { 25 .rel {
27 background-color: rgb(255, 255, 255); 26 background-color: rgb(255, 255, 255);
28 - width: 350rpx; 27 + width: 346rpx;
29 height: 430rpx; 28 height: 430rpx;
30 border-radius: 20rpx; 29 border-radius: 20rpx;
31 display: inline-block; 30 display: inline-block;
32 - margin-right: 15rpx; 31 + /* margin-right: 15rpx; */
33 margin-bottom: 20rpx; 32 margin-bottom: 20rpx;
34 box-shadow: 0rpx 3rpx 3rpx 3rpx rgb(233, 233, 233); 33 box-shadow: 0rpx 3rpx 3rpx 3rpx rgb(233, 233, 233);
35 } 34 }
@@ -45,12 +44,13 @@ page { @@ -45,12 +44,13 @@ page {
45 } 44 }
46 45
47 .Serviceitems { 46 .Serviceitems {
48 - position: absolute;  
49 - top: 370rpx;  
50 - left: 0rpx; 47 + /* position: absolute; */
  48 + /* top: 370rpx;
  49 + left: 0rpx; */
  50 + padding: 300rpx 20rpx 0;
51 z-index: 2; 51 z-index: 2;
52 - padding-left: 18rpx;  
53 - padding-bottom: 20rpx; 52 + /* padding-left: 18rpx;
  53 + padding-bottom: 20rpx; */
54 } 54 }
55 55
56 .itemimage { 56 .itemimage {
@@ -158,10 +158,11 @@ page { @@ -158,10 +158,11 @@ page {
158 } 158 }
159 159
160 .After_all .Line { 160 .After_all .Line {
161 - border-top: 3rpx solid rgb(0, 0, 0);  
162 - width: 130rpx; 161 + border-top: 3rpx solid #ccc;
  162 + width: 50rpx;
163 } 163 }
164 164
165 .After_all .end { 165 .After_all .end {
166 margin: 0rpx 15rpx; 166 margin: 0rpx 15rpx;
  167 + color: #ccc;
167 } 168 }
pages/user/userinfo/userinfo.js
@@ -68,6 +68,7 @@ Page({ @@ -68,6 +68,7 @@ Page({
68 is_lable_set: "", //是否启用我的兴趣标签 68 is_lable_set: "", //是否启用我的兴趣标签
69 check_label: [], //我选择的兴趣标签 69 check_label: [], //我选择的兴趣标签
70 fir_guide_id:null, //存储会员详情接口出来的美导ID 70 fir_guide_id:null, //存储会员详情接口出来的美导ID
  71 + reg_info:null
71 72
72 }, 73 },
73 //通过路径跳转到其他页面 74 //通过路径跳转到其他页面
@@ -86,6 +87,18 @@ Page({ @@ -86,6 +87,18 @@ Page({
86 guide_title:sms_conf.guide_consultant, //系统参数 导购标题 87 guide_title:sms_conf.guide_consultant, //系统参数 导购标题
87 guide_change_time:sms_conf.guide_change_time //每月能修改几次 88 guide_change_time:sms_conf.guide_change_time //每月能修改几次
88 }) 89 })
  90 +
  91 + let reg_type = ee.reg_type;
  92 + let reg_info = ee.reg_info;
  93 + if(reg_type) { //reg_type为1才显示积分信息
  94 + if(reg_info) {
  95 + reg_info = JSON.parse(reg_info);
  96 + th.setData({reg_info:reg_info});
  97 + }
  98 + }
  99 +
  100 +
  101 +
89 if (sms_conf.user_label_set) { 102 if (sms_conf.user_label_set) {
90 th.query_checklabels(); 103 th.query_checklabels();
91 } 104 }
@@ -185,9 +198,20 @@ Page({ @@ -185,9 +198,20 @@ Page({
185 } 198 }
186 }, 199 },
187 bindChange: function(e) { 200 bindChange: function(e) {
188 - this.setData({  
189 - datet: e.detail.value,  
190 - }); 201 +
  202 + let strBirthday = e.detail.value;
  203 + let age = this.verifyBirthday(strBirthday);
  204 +
  205 + if(age <= 10) {
  206 + getApp().my_warnning("会员年龄不能小于10岁(含10岁)", 0, this);
  207 + } else if(age >= 70) {
  208 + getApp().my_warnning("会员年龄不能超过70岁(含70岁)", 0, this);
  209 + } else {
  210 + this.setData({
  211 + datet: e.detail.value,
  212 + });
  213 + };
  214 +
191 }, 215 },
192 //---点击二级之后的选择--- 216 //---点击二级之后的选择---
193 choose_for_store: function(e) { 217 choose_for_store: function(e) {
@@ -564,6 +588,7 @@ Page({ @@ -564,6 +588,7 @@ Page({
564 }, 588 },
565 //------初始化加载---------- 589 //------初始化加载----------
566 onLoad: function(t) { 590 onLoad: function(t) {
  591 + var th=this;
567 var user = getApp().globalData.userInfo; 592 var user = getApp().globalData.userInfo;
568 if (user.card_field != '' && user.card_field != null && user.card_field != undefined && user.card_expiredate) { 593 if (user.card_field != '' && user.card_field != null && user.card_field != undefined && user.card_expiredate) {
569 var now = ut.gettimestamp(); 594 var now = ut.gettimestamp();
@@ -575,6 +600,9 @@ Page({ @@ -575,6 +600,9 @@ Page({
575 } 600 }
576 } 601 }
577 this.initial_user(); 602 this.initial_user();
  603 +
  604 +
  605 +
578 }, 606 },
579 //-----------会员是否初始化--------------------- 607 //-----------会员是否初始化---------------------
580 initial_user: function() { 608 initial_user: function() {
@@ -665,8 +693,7 @@ Page({ @@ -665,8 +693,7 @@ Page({
665 a.staffName=choice_guide.StaffName; 693 a.staffName=choice_guide.StaffName;
666 a.staffId=choice_guide.Id; 694 a.staffId=choice_guide.Id;
667 } 695 }
668 -  
669 - 696 +
670 e.setData({ 697 e.setData({
671 phone: a.mobile, 698 phone: a.mobile,
672 user: a, 699 user: a,
@@ -677,7 +704,9 @@ Page({ @@ -677,7 +704,9 @@ Page({
677 address: a.address, 704 address: a.address,
678 isGender: a.sex, 705 isGender: a.sex,
679 isstcsp: a.vipnopwd, 706 isstcsp: a.vipnopwd,
680 - iscalendar:a.islunar 707 + iscalendar:a.islunar,
  708 + user2:a,
  709 + datet:a.birthday
681 }); 710 });
682 711
683 } 712 }
@@ -802,7 +831,9 @@ Page({ @@ -802,7 +831,9 @@ Page({
802 }, 831 },
803 832
804 //点击确认修改信息 833 //点击确认修改信息
805 - confirm_revision: function() { 834 + confirm_revision: function() {
  835 +
  836 +
806 var th = this; 837 var th = this;
807 var isstcsp = th.data.isstcsp; //是否启用消费密码 838 var isstcsp = th.data.isstcsp; //是否启用消费密码
808 var phone = th.data.phone; //手机号码 839 var phone = th.data.phone; //手机号码
@@ -810,6 +841,9 @@ Page({ @@ -810,6 +841,9 @@ Page({
810 getApp().my_warnning("手机不能为空", 0, th); 841 getApp().my_warnning("手机不能为空", 0, th);
811 return false; 842 return false;
812 } 843 }
  844 + var address = th.data.address; //地址
  845 + var sto_sele_id = th.data.sto_sele_id;
  846 +
813 var consumption = th.data.consumption; //消费密码 847 var consumption = th.data.consumption; //消费密码
814 var isstcsp = th.data.isstcsp; 848 var isstcsp = th.data.isstcsp;
815 if (isstcsp == 1) { 849 if (isstcsp == 1) {
@@ -824,7 +858,6 @@ Page({ @@ -824,7 +858,6 @@ Page({
824 } 858 }
825 } 859 }
826 var sex = th.data.isGender; //性别 860 var sex = th.data.isGender; //性别
827 -  
828 if (sex != "1" && sex != "2") { 861 if (sex != "1" && sex != "2") {
829 getApp().my_warnning("请选择性别", 0, th); 862 getApp().my_warnning("请选择性别", 0, th);
830 return false; 863 return false;
@@ -834,14 +867,34 @@ Page({ @@ -834,14 +867,34 @@ Page({
834 getApp().my_warnning("请输入名字", 0, th); 867 getApp().my_warnning("请输入名字", 0, th);
835 return false; 868 return false;
836 } 869 }
  870 +
837 var identity_card = th.data.identity_card; //身份证 871 var identity_card = th.data.identity_card; //身份证
838 -  
839 if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) { 872 if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) {
840 getApp().my_warnning("身份证号码错误", 0, th); 873 getApp().my_warnning("身份证号码错误", 0, th);
841 return false; 874 return false;
842 - }  
843 - var address = th.data.address; //地址  
844 - var sto_sele_id = th.data.sto_sele_id; 875 + }
  876 + if(th.data.user2.idcard && (!identity_card || identity_card=='') ){
  877 + getApp().my_warnning("身份证不能为空", 0, th);
  878 + return false;
  879 + }
  880 + if(th.data.user2.address && (!address || address=='') ){
  881 + getApp().my_warnning("地址不能为空", 0, th);
  882 + return false;
  883 + }
  884 + if(th.data.user2.pickup_id && (!sto_sele_id || sto_sele_id=='') ){
  885 + getApp().my_warnning("门店不能为空", 0, th);
  886 + return false;
  887 + }
  888 + if(th.data.user2.birthday && (!th.data.datet || th.data.datet =='') ){
  889 + getApp().my_warnning("生日不能为空", 0, th);
  890 + return false;
  891 + }
  892 +
  893 + if(this.data.confirmed) return false;
  894 + this.data.confirmed=1;
  895 +
  896 +
  897 +
845 var datas = { 898 var datas = {
846 mobile: phone, //手机号码 899 mobile: phone, //手机号码
847 store_id: r.stoid, 900 store_id: r.stoid,
@@ -864,6 +917,9 @@ Page({ @@ -864,6 +917,9 @@ Page({
864 getApp().request.put("/api/weshop/users/updateUserInfo", { 917 getApp().request.put("/api/weshop/users/updateUserInfo", {
865 data: datas, 918 data: datas,
866 success: function(res) { 919 success: function(res) {
  920 +
  921 + th.data.confirmed=0;
  922 +
867 if (res.data.code == 0) { 923 if (res.data.code == 0) {
868 getApp().my_warnning("修改成功", 1, th); 924 getApp().my_warnning("修改成功", 1, th);
869 getApp().goto("/pages/user/index/index"); 925 getApp().goto("/pages/user/index/index");
@@ -911,7 +967,58 @@ Page({ @@ -911,7 +967,58 @@ Page({
911 } 967 }
912 } 968 }
913 }); 969 });
914 - } 970 + },
  971 +
  972 + // 生日判断
  973 + verifyBirthday(strBirthday) {
  974 + var returnAge;
  975 + var strBirthdayArr = strBirthday.split("-");
  976 + var birthYear = strBirthdayArr[0];
  977 + var birthMonth = strBirthdayArr[1];
  978 + var birthDay = strBirthdayArr[2];
  979 +
  980 + d = new Date();
  981 + var nowYear = d.getFullYear();
  982 + var nowMonth = d.getMonth() + 1;
  983 + var nowDay = d.getDate();
  984 +
  985 + if(nowYear == birthYear){
  986 + returnAge = 0;//同年 则为0岁
  987 + } else {
  988 + var ageDiff = nowYear - birthYear ; //年之差
  989 + if(ageDiff > 0){
  990 + if(nowMonth == birthMonth) {
  991 + var dayDiff = nowDay - birthDay;//日之差
  992 + if(dayDiff < 0)
  993 + {
  994 + returnAge = ageDiff - 1;
  995 + }
  996 + else
  997 + {
  998 + returnAge = ageDiff ;
  999 + }
  1000 + }
  1001 + else
  1002 + {
  1003 + var monthDiff = nowMonth - birthMonth;//月之差
  1004 + if(monthDiff < 0)
  1005 + {
  1006 + returnAge = ageDiff - 1;
  1007 + }
  1008 + else
  1009 + {
  1010 + returnAge = ageDiff ;
  1011 + }
  1012 + }
  1013 + }
  1014 + else
  1015 + {
  1016 + returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
  1017 + }
  1018 + }
  1019 + return returnAge;//返回周岁年龄
  1020 + },
  1021 +
915 1022
916 1023
917 }); 1024 });
918 \ No newline at end of file 1025 \ No newline at end of file
pages/user/userinfo/userinfo.wxml
@@ -108,8 +108,15 @@ @@ -108,8 +108,15 @@
108 </block> 108 </block>
109 <view class="fs26">女</view> 109 <view class="fs26">女</view>
110 </view> 110 </view>
  111 +
  112 + <block wx:if="{{reg_info && reg_info.sex_state && reg_info.sex}}">
  113 + <view wx:if="{{!user.sex}}" class="fs28 co-red show_jf_val">+{{reg_info.sex}}
  114 + <text wx:if="{{reg_info.sex_state_type == 0}}">积分</text>
  115 + <text wx:if="{{reg_info.sex_state_type == 1}}">成长值</text>
  116 + </view>
  117 + </block>
111 </view> 118 </view>
112 - 119 +
113 </view> 120 </view>
114 121
115 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="sex"> 122 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="sex">
@@ -144,27 +151,47 @@ @@ -144,27 +151,47 @@
144 </block> 151 </block>
145 <block wx:else> 152 <block wx:else>
146 <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view> 153 <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view>
147 - </block>  
148 - 154 + </block>
149 </view> 155 </view>
  156 +
  157 +
  158 + <block wx:if="{{reg_info && reg_info.birthday_state && reg_info.birthday}}">
  159 + <view wx:if="{{!user.birthday}}" class="fs28 co-red show_jf_val">+{{reg_info.birthday}}
  160 + <text wx:if="{{reg_info.birthday_type == 0}}">积分</text>
  161 + <text wx:if="{{reg_info.birthday_type == 1}}">成长值</text>
  162 + </view>
  163 + </block>
  164 +
150 </view> 165 </view>
151 - </view> 166 +
  167 + </view>
152 </view> 168 </view>
153 <view class="Bbottom"> 169 <view class="Bbottom">
154 <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname"> 170 <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname">
155 <view class="user-name-txt">姓名</view> 171 <view class="user-name-txt">姓名</view>
156 - <input bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' /> 172 + <view class="flex ai-center">
  173 + <input bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' />
  174 +
  175 + <block wx:if="{{reg_info && reg_info.name_state && reg_info.name}}">
  176 + <view wx:if="{{!user2.vipname}}" class="fs28 co-red show_jf_val">+{{reg_info.name}}
  177 + <text wx:if="{{reg_info.name_val_type == 0}}">积分</text>
  178 + <text wx:if="{{reg_info.name_val_type == 1}}">成长值</text>
  179 + </view>
  180 + </block>
  181 + </view>
157 </view> 182 </view>
158 183
159 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname"> 184 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname">
160 <view class="user-name-txt">身份证</view> 185 <view class="user-name-txt">身份证</view>
161 -  
162 - <input bindblur="identity_card" class="user-txt-right t-r" value="{{user.idcard}}" placeholder="*身份证"></input>  
163 -  
164 -  
165 - <!-- <block wx:else>  
166 - <input class="user-txt-right" bindblur="IdentityIDCard" value="" type="idcard" maxlength="18" placeholder="*身份证" />  
167 - </block> --> 186 + <view class="flex ai-center">
  187 + <input bindblur="identity_card" class="user-txt-right t-r" value="{{user.idcard}}" placeholder="*身份证"></input>
  188 + <block wx:if="{{reg_info && reg_info.idcard_state && reg_info.idcard}}">
  189 + <view wx:if="{{!user2.idcard}}" class="fs28 co-red show_jf_val" >+{{reg_info.idcard}}
  190 + <text wx:if="{{reg_info.idcard_type == 0}}">积分</text>
  191 + <text wx:if="{{reg_info.idcard_type == 1}}">成长值</text>
  192 + </view>
  193 + </block>
  194 + </view>
168 </view> 195 </view>
169 <view data-url="/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile"> 196 <view data-url="/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile">
170 <view class="user-name-txt">更换手机</view> 197 <view class="user-name-txt">更换手机</view>
@@ -180,8 +207,16 @@ @@ -180,8 +207,16 @@
180 <view>{{user.address}}</view> 207 <view>{{user.address}}</view>
181 </block> 208 </block>
182 <block wx:else> --> 209 <block wx:else> -->
183 - <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right" placeholder="*地址" style="text-align:right" />  
184 - <!-- </block> --> 210 + <view class="flex ai-center">
  211 + <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right" placeholder="*地址" style="text-align:right" />
  212 + <!-- </block> -->
  213 + <block wx:if="{{reg_info && reg_info.address_state && reg_info.address}}">
  214 + <view wx:if="{{!user2.address}}" class="fs28 co-red show_jf_val" >+{{reg_info.address}}
  215 + <text wx:if="{{reg_info.address_type == 0}}">积分</text>
  216 + <text wx:if="{{reg_info.address_type == 1}}">成长值</text>
  217 + </view>
  218 + </block>
  219 + </view>
185 </view> 220 </view>
186 221
187 <!-- 选择门店 --> 222 <!-- 选择门店 -->
@@ -190,7 +225,14 @@ @@ -190,7 +225,14 @@
190 <view class="flex-center user-txt-right"> 225 <view class="flex-center user-txt-right">
191 <view class="one-line">{{stoname}}</view> 226 <view class="one-line">{{stoname}}</view>
192 <view class="angle">∟</view> 227 <view class="angle">∟</view>
  228 + <block wx:if="{{reg_info && reg_info.pick_state && reg_info.pick}}">
  229 + <view wx:if="{{!user.pickup_id}}" class="fs28 co-red show_jf_val">+{{reg_info.pick}}
  230 + <text wx:if="{{reg_info.pick_type == 0}}">积分</text>
  231 + <text wx:if="{{reg_info.pick_type == 1}}">成长值</text>
  232 + </view>
  233 + </block>
193 </view> 234 </view>
  235 +
194 </view> 236 </view>
195 237
196 <!-- 美容顾问 --> 238 <!-- 美容顾问 -->
pages/user/userinfo/userinfo.wxss
@@ -662,3 +662,5 @@ input { @@ -662,3 +662,5 @@ input {
662 height: 46rpx; 662 height: 46rpx;
663 line-height: 46rpx; 663 line-height: 46rpx;
664 } 664 }
  665 +
  666 +.show_jf_val{ margin-left: 5rpx;}
utils/pay.js
@@ -52,6 +52,7 @@ module.exports = { @@ -52,6 +52,7 @@ module.exports = {
52 }); 52 });
53 }, 53 },
54 weixinPay: function(n, e, a) { 54 weixinPay: function(n, e, a) {
  55 + if(!n) return false;
55 wx.requestPayment({ 56 wx.requestPayment({
56 timeStamp: String(n.timeStamp), 57 timeStamp: String(n.timeStamp),
57 nonceStr: n.nonceStr, 58 nonceStr: n.nonceStr,
utils/pay2.js
@@ -27,6 +27,7 @@ module.exports = { @@ -27,6 +27,7 @@ module.exports = {
27 }); 27 });
28 }, 28 },
29 weixinPay: function(n, succ,fail) { 29 weixinPay: function(n, succ,fail) {
  30 + if(!n) return false;
30 wx.requestPayment({ 31 wx.requestPayment({
31 timeStamp: String(n.timeStamp), 32 timeStamp: String(n.timeStamp),
32 nonceStr: n.nonceStr, 33 nonceStr: n.nonceStr,