Commit 27a76a60dd727119ba7de6dc9aaca877fbe77592

Authored by taiyuan
2 parents 763c4721 6fc46e49

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

@@ -92,8 +92,15 @@ App({ @@ -92,8 +92,15 @@ App({
92 if(!app.globalData.userInfo){ 92 if(!app.globalData.userInfo){
93 var user = wx.getStorageSync("userinfo"); 93 var user = wx.getStorageSync("userinfo");
94 if (user && user.user_id){ 94 if (user && user.user_id){
95 - app.globalData.userInfo=wx.getStorageSync("userinfo");  
96 - app.globalData.user_id= app.globalData.userInfo.user_id; 95 + //--生成会员 --
  96 + app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id,{}).then(res=>{
  97 + if(res.data.code==0){
  98 + user=res.data.data;
  99 + app.globalData.userInfo=user;
  100 + app.globalData.user_id= user.user_id;
  101 + wx.setStorageSync("userinfo",user);
  102 + }
  103 + })
97 } 104 }
98 } 105 }
99 wx.getSystemInfo({ 106 wx.getSystemInfo({
@@ -561,7 +568,11 @@ App({ @@ -561,7 +568,11 @@ App({
561 this.globalData.room_id=null; //关闭要把房间号关闭 568 this.globalData.room_id=null; //关闭要把房间号关闭
562 this.globalData.room_goods_id=null; //关闭要把物流清空 569 this.globalData.room_goods_id=null; //关闭要把物流清空
563 this.globalData.config2=null; //清除config2的缓存 570 this.globalData.config2=null; //清除config2的缓存
564 - this.globalData.config=null; //清除config的缓存 571 + this.globalData.config=null; //清除config的缓存
  572 + this.globalData.gr_index=0; //商品分组的序列
  573 + for(var i = 1; i < 50; i++) {
  574 + clearInterval(i);
  575 + }
565 }, 576 },
566 577
567 clear_word:function (word) { 578 clear_word:function (word) {
custom-tab-bar/index.js
@@ -14,16 +14,14 @@ Component({ @@ -14,16 +14,14 @@ Component({
14 lifetimes: { 14 lifetimes: {
15 attached: function() { 15 attached: function() {
16 var th=this; 16 var th=this;
17 -  
18 - getApp().getConfig2(function(){  
19 - var e = getApp().globalData.config2;  
20 - var json_d = JSON.parse(e.switch_list);  
21 - if(!json_d.distribut_switch){  
22 - th.setData({is_no_distri:1})  
23 - }  
24 - })  
25 -  
26 - 17 +
  18 + getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
  19 + var dis=rs.data.data;
  20 + if( dis && dis.switch==0){
  21 + th.setData({is_no_distri:1})
  22 + }
  23 + })
  24 +
27 getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{ 25 getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{
28 if(res.data.code==0){ 26 if(res.data.code==0){
29 var arr = res.data.data.pageData; 27 var arr = res.data.data.pageData;
packageA/pages/distribution/card/card.js
@@ -22,6 +22,9 @@ Page({ @@ -22,6 +22,9 @@ Page({
22 userInfo: data, 22 userInfo: data,
23 }); 23 });
24 }); 24 });
  25 + wx.setNavigationBarTitle({
  26 + title: "我的名片",
  27 + });
25 }, 28 },
26 29
27 /** 30 /**
packageA/pages/distribution/commision/commision.js
@@ -28,6 +28,10 @@ Page({ @@ -28,6 +28,10 @@ Page({
28 * 生命周期函数--监听页面加载 28 * 生命周期函数--监听页面加载
29 */ 29 */
30 onLoad: function (options) { 30 onLoad: function (options) {
  31 + wx.setNavigationBarTitle({
  32 + title: "佣金明细",
  33 + });
  34 +
31 this.setData({ 35 this.setData({
32 currentSelect: this.data.dropdownArr[0], 36 currentSelect: this.data.dropdownArr[0],
33 }); 37 });
packageA/pages/distribution/goods/goods.js
@@ -37,6 +37,11 @@ Page({ @@ -37,6 +37,11 @@ Page({
37 * 生命周期函数--监听页面加载 37 * 生命周期函数--监听页面加载
38 */ 38 */
39 onLoad: function (options) { 39 onLoad: function (options) {
  40 +
  41 + wx.setNavigationBarTitle({
  42 + title: "上下架商品",
  43 + });
  44 +
40 self = this;//保存全局指针 45 self = this;//保存全局指针
41 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 46 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
42 self.setData({ 47 self.setData({
packageA/pages/distribution/goods/goods.json
@@ -2,6 +2,6 @@ @@ -2,6 +2,6 @@
2 "usingComponents": { 2 "usingComponents": {
3 "nodata": "/components/nodata/nodata" 3 "nodata": "/components/nodata/nodata"
4 }, 4 },
5 - "navigationBarTitleText": "我的名片", 5 + "navigationBarTitleText": "上下架商品",
6 "enablePullDownRefresh": false 6 "enablePullDownRefresh": false
7 } 7 }
8 \ No newline at end of file 8 \ No newline at end of file
packageA/pages/distribution/myteam/myteam.js
@@ -21,6 +21,10 @@ Page({ @@ -21,6 +21,10 @@ Page({
21 * 生命周期函数--监听页面加载 21 * 生命周期函数--监听页面加载
22 */ 22 */
23 onLoad: function (options) { 23 onLoad: function (options) {
  24 + wx.setNavigationBarTitle({
  25 + title: "我的团队",
  26 + });
  27 +
24 self = this;//保存全局指针 28 self = this;//保存全局指针
25 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 29 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
26 self.setData({ 30 self.setData({
packageA/pages/distribution/order/order.js
@@ -27,6 +27,11 @@ Page({ @@ -27,6 +27,11 @@ Page({
27 * 生命周期函数--监听页面加载 27 * 生命周期函数--监听页面加载
28 */ 28 */
29 onLoad: function (options) { 29 onLoad: function (options) {
  30 +
  31 + wx.setNavigationBarTitle({
  32 + title: "分销订单",
  33 + });
  34 +
30 self = this;//保存全局指针 35 self = this;//保存全局指针
31 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 36 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
32 self.setData({ 37 self.setData({
packageA/pages/distribution/rank/rank.js
@@ -21,6 +21,10 @@ Page({ @@ -21,6 +21,10 @@ Page({
21 * 生命周期函数--监听页面加载 21 * 生命周期函数--监听页面加载
22 */ 22 */
23 onLoad: function (options) { 23 onLoad: function (options) {
  24 + wx.setNavigationBarTitle({
  25 + title: "分销排行榜",
  26 + });
  27 +
24 self = this;//保存全局指针 28 self = this;//保存全局指针
25 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 29 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
26 self.setData({ 30 self.setData({
packageA/pages/distribution/rookie/rookie.js
@@ -19,7 +19,10 @@ Page({ @@ -19,7 +19,10 @@ Page({
19 */ 19 */
20 onLoad: function (options) { 20 onLoad: function (options) {
21 self = this; 21 self = this;
22 - 22 +
  23 + wx.setNavigationBarTitle({
  24 + title: "新手必看",
  25 + });
23 // 判断会员是否授权登录, 26 // 判断会员是否授权登录,
24 // 没有登录则跳转到登录页, 27 // 没有登录则跳转到登录页,
25 // 已登录则设置已登录状态,请求加载数据 28 // 已登录则设置已登录状态,请求加载数据
packageA/pages/distribution/shop/shop.js
@@ -44,6 +44,10 @@ Page({ @@ -44,6 +44,10 @@ Page({
44 * 生命周期函数--监听页面加载 44 * 生命周期函数--监听页面加载
45 */ 45 */
46 onLoad: function (options) { 46 onLoad: function (options) {
  47 +
  48 + wx.setNavigationBarTitle({
  49 + title: "我的小店",
  50 + });
47 self = this;//保存全局指针 51 self = this;//保存全局指针
48 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 52 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
49 self.setData({ 53 self.setData({
@@ -63,9 +67,9 @@ Page({ @@ -63,9 +67,9 @@ Page({
63 success: function (e) { 67 success: function (e) {
64 if(e.data.code==0){ 68 if(e.data.code==0){
65 self.setData({ 69 self.setData({
66 - userInfo2: e.data.data, 70 + userInfo2:e.data.data,
67 }); 71 });
68 - } ; 72 + };
69 73
70 }, 74 },
71 }); 75 });
pages/distribution/distribution.js
@@ -24,6 +24,9 @@ Page({ @@ -24,6 +24,9 @@ Page({
24 }else{ 24 }else{
25 getApp().goto("/pages/togoin/togoin") //跳到非tabbar页 25 getApp().goto("/pages/togoin/togoin") //跳到非tabbar页
26 } 26 }
  27 + wx.setNavigationBarTitle({
  28 + title: "我的分销",
  29 + });
27 30
28 }, 31 },
29 32
@@ -117,55 +120,74 @@ Page({ @@ -117,55 +120,74 @@ Page({
117 120
118 //如果不是分销会员的话 121 //如果不是分销会员的话
119 if(!app.globalData.userInfo['is_distribut']){ 122 if(!app.globalData.userInfo['is_distribut']){
120 - app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {  
121 - data: {  
122 - storeId: self.data.userInfo.store_id,  
123 - userId: self.data.userInfo.user_id,  
124 - first_leader: self.data.userInfo.first_leader,  
125 - },  
126 - isShowLoading: true,  
127 - }).then(function(res) {  
128 - console.log('!!!===>', res);  
129 - if(res.data.code == 0) {  
130 - var data={  
131 - fenxiao: res.data.data,  
132 - };  
133 - var goods=null;  
134 - var isall_pass=1;  
135 - for(var i in res.data.data){  
136 - if(!res.data.data[i].pass){ isall_pass=0; }  
137 - if(res.data.data[i].type==3 && res.data.data[i].conditonRemark){  
138 - goods={is_buy:1,url:'/pages/index/index/index'};  
139 - if(res.data.data[i].goods_id){  
140 - goods.url='/pages/goods/goodsInfo/goodsInfo?goods_id='+res.data.data[i].goods_id;  
141 - }  
142 - break;  
143 - }  
144 - }  
145 - if(goods){  
146 - data.buy_goods=goods;  
147 - }  
148 - self.setData(data);  
149 - //如果全部都更新了通过的话  
150 - if(isall_pass){  
151 - wx.showToast({  
152 - title: "全部满足成为分销商",  
153 - icon: 'none',  
154 - duration: 2000  
155 - }); 123 +
  124 + var res=null;
  125 + await app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {
  126 + data: {
  127 + storeId: self.data.userInfo.store_id,
  128 + userId: self.data.userInfo.user_id,
  129 + first_leader: self.data.userInfo.first_leader,
  130 + },
  131 + isShowLoading: true,
  132 + }).then(function(res1) {
  133 + res=res1;
  134 + });
  135 +
  136 + if(res && res.data.code == 0) {
  137 + var data={
  138 + fenxiao: res.data.data,
  139 + };
  140 + var goods=null;
  141 + var isall_pass=1;
  142 + for(var i in res.data.data){
  143 + if(!res.data.data[i].pass){ isall_pass=0; }
  144 + if(res.data.data[i].type==3 && res.data.data[i].conditonRemark){
  145 + goods={is_buy:1,url:'/pages/index/index/index'};
  146 + if(res.data.data[i].goods_id){
  147 + goods.url='/pages/goods/goodsInfo/goodsInfo?goods_id='+res.data.data[i].goods_id;
  148 + }
  149 + break;
  150 + }
  151 + if(res.data.data[i].type==2){
  152 + if(!res.data.data[i].inviter && getApp().globalData.first_leader){
  153 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  154 + if(res.data.code==0){
  155 + var user= res.data.data;
  156 + if(user.is_distribut==1){
  157 + data.fenxiao[i].inviter=user.mobile;
  158 +
  159 + self.setData(data);
  160 + }
  161 + }
  162 + })
  163 + }
  164 + }
  165 + }
  166 + if(goods){
  167 + data.buy_goods=goods;
  168 + }
  169 + self.setData(data);
  170 + //如果全部都更新了通过的话
  171 + if(isall_pass){
  172 + wx.showToast({
  173 + title: "全部满足成为分销商",
  174 + icon: 'none',
  175 + duration: 2000
  176 + });
156 //-- 会员的分销的内容要进行存储 -- 177 //-- 会员的分销的内容要进行存储 --
157 app.globalData.userInfo.is_distribut=1; 178 app.globalData.userInfo.is_distribut=1;
158 wx.setStorageSync("userinfo",app.globalData.userInfo); 179 wx.setStorageSync("userinfo",app.globalData.userInfo);
159 - setTimeout(function(){  
160 - self.getDis_data(); 180 + setTimeout(function(){
  181 + self.getDis_data();
161 self.setData({ 182 self.setData({
162 userInfo: app.globalData.userInfo, 183 userInfo: app.globalData.userInfo,
163 }); 184 });
164 - },2000)  
165 - }  
166 - }  
167 -  
168 - }); 185 + },2000)
  186 + }
  187 + }
  188 +
  189 +
  190 +
169 }else{ 191 }else{
170 self.getDis_data() 192 self.getDis_data()
171 } 193 }
pages/distribution/distribution.wxml
@@ -102,8 +102,9 @@ @@ -102,8 +102,9 @@
102 <view class="item" wx:if="{{item.type == 2}}"> 102 <view class="item" wx:if="{{item.type == 2}}">
103 <view class="left f1"> 103 <view class="left f1">
104 <view class="icon-container"><text class="iconfont icon-renzheng"></text></view> 104 <view class="icon-container"><text class="iconfont icon-renzheng"></text></view>
105 - <view class="flex ali-c">  
106 - <input class="bg-f0 pdh10 input" type="number" value="{{item.inviter ? item.inviter:''}}" placeholder="请输入推荐人手机号码" disabled="{{item.pass}}" bindinput="getInput"/> 105 + <view class="flex ali-c">
  106 + <text wx:if="{{item.inviter}}">{{item.inviter}}</text>
  107 + <input wx:else class="bg-f0 pdh10 input" type="number" value="{{item.inviter ? item.inviter:''}}" placeholder="请输入推荐人手机号码" disabled="{{item.pass}}" bindinput="getInput"/>
107 <view class="verify" wx:if="{{!item.pass}}" bindtap="verify" data-index="{{index}}" data-pass="{{item.pass}}">验证</view> 108 <view class="verify" wx:if="{{!item.pass}}" bindtap="verify" data-index="{{index}}" data-pass="{{item.pass}}">验证</view>
108 </view> 109 </view>
109 </view> 110 </view>
pages/goods/categoryList/categoryList.js
@@ -91,8 +91,15 @@ Page({ @@ -91,8 +91,15 @@ Page({
91 91
92 onLoad: function(tt) { 92 onLoad: function(tt) {
93 var that = this; 93 var that = this;
  94 + var first_leader=tt.first_leader;
  95 + if(first_leader){
  96 + //-- user_id代过来免登录 --
  97 + getApp().globalData.first_leader=first_leader;
  98 + }
  99 +
  100 +
94 that.get_brand(); 101 that.get_brand();
95 - 102 +
96 clearInterval(that.data.timer); 103 clearInterval(that.data.timer);
97 that.setData({ countDownNum: 3, stylePage: 1 }); 104 that.setData({ countDownNum: 3, stylePage: 1 });
98 105
@@ -570,8 +577,19 @@ Page({ @@ -570,8 +577,19 @@ Page({
570 }, 577 },
571 //---------分享配置-------- 578 //---------分享配置--------
572 onShareAppMessage: function (e) { 579 onShareAppMessage: function (e) {
  580 +
  581 + url="pages/goods/categoryList/categoryList";
  582 + var userInfo=getApp().globalData.userInfo;
  583 + //是分销商才带
  584 + if(userInfo){
  585 + url+="?first_leader="+userInfo.user_id;
  586 + }
  587 + console.log("--分类分享---分享--");
  588 + console.log(url);
  589 +
573 return { 590 return {
574 - title: "商品分类", 591 + title: "商品分类",
  592 + path:url,
575 } 593 }
576 }, 594 },
577 //图片失败,默认图片 595 //图片失败,默认图片
pages/index/index/index.js
@@ -592,11 +592,19 @@ Page({ @@ -592,11 +592,19 @@ Page({
592 url+="?first_leader="+userInfo.user_id; 592 url+="?first_leader="+userInfo.user_id;
593 } 593 }
594 console.log("---首页---分享--"); 594 console.log("---首页---分享--");
595 - console.log(url); 595 + var title="商城首页"
  596 + //分享
  597 + if(getApp().globalData.config.store_name){
  598 + title=getApp().globalData.config.store_name;
  599 + }else if(getApp().globalData.setting.appName){
  600 + title=getApp().globalData.setting.appName;
  601 + }
  602 +
596 var ob={ 603 var ob={
597 title: getApp().globalData.config.store_name, 604 title: getApp().globalData.config.store_name,
598 path:url, 605 path:url,
599 - }; 606 + };
  607 + console.log(ob);
600 return ob; 608 return ob;
601 }, 609 },
602 610
pages/togoin/togoin.js
@@ -22,8 +22,8 @@ Page({ @@ -22,8 +22,8 @@ Page({
22 } 22 }
23 var th=this; 23 var th=this;
24 app.getConfig(function (e) { 24 app.getConfig(function (e) {
25 - e.store_logo=th.data.imghots+e.store_logo;  
26 - th.setData({ store: e,store_logo:e.store_logo}); 25 + var logo=th.data.imghots+e.store_logo;
  26 + th.setData({ store: e,store_logo:logo});
27 }) 27 })
28 }, 28 },
29 //绑定手机号 29 //绑定手机号