YanaDH 7 năm trước cách đây
mục cha
commit
97cdb8da6d

+ 7 - 2
miaomiao/www/js/config/router.js

xqd
@@ -456,10 +456,15 @@
             // 举报
             .state('app.homeContact', {
                 url: '/home/contact',
+                params: {
+                    user_name: null,
+                    dream_id: null,
+                    dream_name: null
+                },
                 views: {
                     'app-home': {
-                        templateUrl: 'templates/my/contact.html',
-                        controller: 'contactCtrl'
+                        templateUrl: 'templates/home/contact.html',
+                        controller: 'contactHomeCtrl'
                     }
                 }
             })

+ 3 - 0
miaomiao/www/js/controllers/account.js

xqd
@@ -167,6 +167,9 @@
                 $scope.readClauseModal = modal;
             });
             $scope.readClause = function($event){
+                userService.info(type=1).then(function(res){
+                    $scope.info = res.data.data;
+                })
                 $event.stopPropagation();
                 $scope.readClauseModal.show();
             }

+ 7 - 2
miaomiao/www/js/controllers/add.js

xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('addCtrl', ["$scope", "$state",  "dreamService", "msg", "$ionicTabsDelegate", '$ionicModal',"$ionicNavBarDelegate","$ionicHistory", "common", "config"
-        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate,$ionicModal, $ionicNavBarDelegate,$ionicHistory, common, config) {
+    app.controller('addCtrl', ["$scope", "$state", "dreamService", "msg", "$ionicTabsDelegate", '$ionicModal',"$ionicNavBarDelegate","$ionicHistory", "common", "config", "userService"
+        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate,$ionicModal, $ionicNavBarDelegate,$ionicHistory, common, config, userService) {
                         
             $scope.addpict = function () {
                 common.chooseImage().then(function (img) { 
@@ -95,6 +95,11 @@
                 $scope.readClauseModal = modal;
             });
             $scope.readClause = function($event){
+                debugger;
+                userService.info(type=1).then(function(res){
+                    debugger;
+                    $scope.info = res.data.data;
+                })
                 $event.stopPropagation();
                 $scope.readClauseModal.show();
             }

+ 51 - 49
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd xqd
@@ -288,10 +288,10 @@
 
                 $scope.isTest = true;
                 userService.isTest().then(function(res){
-                    if(res.data.data==1){
-                        $scope.isTest = false;
-                    }else{
+                    if(res.data.data){
                         $scope.isTest = true;
+                    }else{
+                        $scope.isTest = false;
                     }
                 })
 
@@ -385,25 +385,19 @@
                         if(result==true){
                             msg.confirm('举报或拉黑该用户','','举报','拉黑').then(function(result){
                                 if(result==true){
-                                    msg.confirm('确定拉黑?').then(function(result){
-                                        if(result==true){
-                                            homeService.report(dream_id,interaction_id,user_id).then(function(result){
-                                                if(result.data.status_code==0){
-                                                    msg.text('已拉黑');
-                                                    $scope.load(dream_id);
-                                                }
-                                            },function(error){
-                                                
-                                            })
+                                    homeService.report(dream_id,interaction_id,user_id).then(function(result){
+                                        if(result.data.status_code==0){
+                                            msg.text('已拉黑');
+                                            $scope.load(dream_id);
+                                        }
+                                    },function(error){
+                                        if(error.data.message == "没有操作权限"){
+                                            msg.text('你不是该梦想的所有者哦!');
                                         }
                                     })
                                 }
                                 else {
-                                    msg.confirm('确定举报?').then(function(result){
-                                        if(result==true){
-                                            $state.go('app.homeContact');
-                                        }
-                                    })
+                                    $state.go('app.homeContact',{user_name: $scope.dream.user.nickname, dream_name: $scope.dream.name, dream_id: $scope.dream.id});
                                 }
                             })
                         }
@@ -411,16 +405,17 @@
                 }
             };
 
-            // 举报或拉黑(主页)
+            // 举报(主页)
             $scope.detailReport = function(ev){
                 ev.stopPropagation();
                 $scope.toshare  = false;
                 msg.confirm('确定举报?').then(function(result){
                     if(result==true){
-                        $state.go('app.homeContact');
+                        $state.go('app.homeContact',{user_name: $scope.dream.user.nickname, dream_name: $scope.dream.name, dream_id: $scope.dream.id});
                     }
                 })
             }
+            // 拉黑(主页)
             $scope.detailDelete = function(ev,user_id){
                 ev.stopPropagation();
                 $scope.toshare  = false;
@@ -460,38 +455,9 @@
 
                 })
             };
-            // $scope.reportUser = function(ev,user_id){
-            //     ev.stopPropagation();
-            //     msg.confirm('举报或拉黑该用户','','举报','拉黑').then(function(result){
-            //         if(result==true){
-            //             msg.confirm('确定拉黑?').then(function(result){
-            //                 if(result==true){
-            //                     var res = typeof(storage.getObject('reportUser'));
-            //                     if(res != 'object'){
-            //                         var reportUser = storage.getObject('reportUser');
-            //                     }
-            //                     else{
-            //                         var reportUser = [];
-            //                     }
-            //                     reportUser.push($scope.dream.user_id);
-            //                     storage.setObject('reportUser',reportUser);
-            //                     msg.text('已拉黑');
-            //                 }
-            //             })
-            //         }
-            //         else {
-            //             msg.confirm('确定举报?').then(function(result){
-            //                 if(result==true){
-            //                     $state.go('app.homeContact');
-            //                 }
-            //             })
-            //         }
-            //     })
-            // }
 
             $scope.load = function (id,dream_user_id,interaction_id) {
                 homeService.dreamDetail(id,dream_user_id,interaction_id).then(function (result) {
-                    console.log(result);
                     $scope.blackUser_id = result.data.data.user_id;
                     $scope.showCode  = function(codeName){
                         $scope.url = codeName;
@@ -1372,5 +1338,41 @@
         $state.go('app.home_dreamdetail',{id:id});
       };
   }]);
+  app.controller('contactHomeCtrl', ["$scope","$ionicTabsDelegate","$stateParams","$location", "$ionicHistory","$timeout","$state", "myService", "msg","storage"
+      , function ($scope,$ionicTabsDelegate,$stateParams,$location,$ionicHistory, $timeout,$state,myService, msg, storage) {
+        $scope.user_name = $stateParams.user_name;
+        $scope.dream_id = $stateParams.dream_id;
+        $scope.dream_name = $stateParams.dream_name;
+          $scope.vm={
+              content:"",
+              email:""
+          };
+          $scope.contact = function(){
+              var data={
+                  data:{
+                      content: $scope.vm.content,
+                      email: $scope.vm.email,
+                      dream_id: $scope.dream_id
+                  }
+              };
+              myService.contact(data).then(function(result){
+                  msg.text("发送成功");
+                  $timeout(function(){
+                      if($location.path()=='/app/home/contact'){
+                          $ionicHistory.goBack();
+                      }
+                      else{
+                          $state.go("app.my");
+                      }
+                  },1000);
+                  $scope.vm={
+                      content:"",
+                      email:""
+                  }
+              },function(error){
+                  msg.error(error.data.message);
+              })
+          }
+      }]);
     
 })(angular.module('app.controllers'));

+ 34 - 55
miaomiao/www/js/controllers/my.js

xqd xqd xqd
@@ -113,10 +113,14 @@
                 $scope.aboutMiao();
             });
             $scope.aboutMiao = function(){
-                myService.aboutMiao().then(function(result){
-                    $scope.items = result.data.data;
-                },function(error){
-                    msg.error(error.data.message)
+                // myService.aboutMiao().then(function(result){
+                //     $scope.items = result.data.data;
+                // },function(error){
+                //     msg.error(error.data.message)
+                // })
+                myService.info(type=2).then(function(res){
+                    debugger;
+                    $scope.info = res.data.data;
                 })
             };
         }]);
@@ -464,59 +468,26 @@
                     $scope.showWithdraw = true;
                 }
                 else{
-                    $scope.showWithdraw = false;
-                }
-            })
-            
-            userService.isTest().then(function(res){
-                if(res.data.data){
-                    Wechat.auth(scope, state, function (response) {
-                        // var response={code:1231};
-                        if(response.code){
-                            msg.loading('登录中...');
-                            userService.wechat_login(response.code).then(function(result){
-                                msg.hide();
-                                if(result.data.data.user){
-                                    storage.setObject('user', result.data.data.user);
-                                    storage.set('token', result.data.data.token);
-                                    $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
-                                    $scope.user=storage.getObject('user');
-                                    $state.go('app.home');
-                                    if(localStorage['jpush']){
-                                        console.log("jpush: " + localStorage['jpush']);
-                                        userService.jpush({ jpush: localStorage['jpush']}).then(function (result) {}, function (error) {});
-                                    }
-                                }else{
-                                    $state.go("loginAccount",{wechat:result.data.data.openid})
-                                }
-                            },function(error){
-                                console.log("loginbywx Failed: " + JSON.stringify(error));
-                                $state.go("loginAccount");
-                            });
-                        }
-                    }, function (error) {
-                        console.log("Failed: " + JSON.stringify(error));
-                    })
-                }
-                else{
-                    $state.go("loginAccount",{wechat:'orrk51inhmfmQRXA8VvGEQfow3Es'});
+                    if($scope.ios.isIOS){
+                        var productIds = ['apple10001','apple102','apple103','apple104']; // <- Add your product Ids here
+                        msg.loading();
+                        inAppPurchase
+                          .getProducts(productIds)
+                          .then(function (products) {
+                            msg.hide();
+                            $scope.showWithdraw = false;
+                            $scope.products = products;
+                            console.log('products:'+JSON.stringify(products));
+                          })
+                          .catch(function (err) {
+                            msg.hide();
+                          });
+                    }
+                    else{
+                        $scope.showWithdraw = true;
+                    }
                 }
             })
-            if($scope.ios.isIOS){
-                var productIds = ['apple10001','apple102','apple103','apple104']; // <- Add your product Ids here
-                msg.loading();
-                // inAppPurchase
-                //   .getProducts(productIds)
-                //   .then(function (products) {
-                //     msg.hide();
-                //     $scope.products = products;
-                //     console.log('products:'+JSON.stringify(products));
-                //   })
-                //   .catch(function (err) {
-                    msg.hide();
-                //     console.log(err);
-                //   });
-            }
         });
         $scope.payExplain = function(){
             $state.go("app.payExplain")
@@ -1069,6 +1040,14 @@
                         }
                     })
                 }
+                else if(attr_id==10){
+                    if($location.path()=="/app/home/message/reply"){
+                        $state.go('app.home_dreamdetail',{id:dream_id,type:3});
+                    }
+                    else {
+                        $state.go('app.my_dreamdetail',{id:dream_id,type:3});
+                    }
+                }
                 //成为梦主
                 else if(is_max==1&&is_end==1){
                     var maxTemplate = '<div style="text-align: center"><p>'+ mes +'</p>' +

+ 3 - 3
miaomiao/www/js/services/httpinterceptor.js

xqd
@@ -41,9 +41,9 @@
                     // alert("not login");
                     return ;
                 }
-                if (rejection.status == 400) {
-                    getMsg().error(rejection.data.message);
-                }
+                // if (rejection.status == 400) {
+                //     getMsg().error(rejection.data.message);
+                // }
                 if (rejection.status==500) {
                     getMsg().error(rejection.data.message);
                 }

+ 12 - 7
miaomiao/www/js/services/myservice.js

xqd xqd
@@ -192,12 +192,12 @@
                     data:data
                 })
             },
-            aboutMiao:function(){
-                return $http({
-                    url:config.server + "api/my/miao",
-                    method:"get"
-                })
-            },
+            // aboutMiao:function(){
+            //     return $http({
+            //         url:config.server + "api/my/miao",
+            //         method:"get"
+            //     })
+            // },
             messageInfo:function(){
                 return $http({
                     url:config.server + "api/my/info",
@@ -227,8 +227,13 @@
                     url:config.server + "api/my/sure_meet2?to_user_id=" + to_user_id + '&value=' + value,
                     method:"get"
                 })
+            },
+            info: function(){
+                return $http({
+                    url: config.server + 'api/info',
+                    method: "get"
+                })
             }
-
         };
     }]);
 })(angular.module('app.services'));

+ 6 - 0
miaomiao/www/js/services/userservice.js

xqd
@@ -36,6 +36,12 @@
             },
             isLogin: function () {
              return !util.empty(storage.get("token")) && storage.getObject("user");
+            },
+            info: function(){
+                return $http({
+                    url: config.server + 'api/info',
+                    method: "get"
+                })
             }
         };
     }]);

+ 3 - 3
miaomiao/www/templates/account/loginAccount.html

xqd xqd
@@ -45,8 +45,8 @@
                 <button class="button button-clear" ng-click="closeClause()">关闭</button>
             </ion-header-bar>
             <ion-content>
-                <div style="margin: 15px; color: #666666;">
-                    <p>
+                <div style="margin: 15px; color: #666666;" ng-bind-html="info|trustHtml">
+                    <!-- <p>
                         欢迎使用瞄喵!
                     </p>
                     <p>
@@ -198,7 +198,7 @@
                     </p>
                     <p>
                         7.3瞄喵在法律允许的最大范围内对本协议拥有解释权与修改权。
-                    </p>
+                    </p> -->
                 </div>
             </ion-content>
         </div>

+ 3 - 3
miaomiao/www/templates/add/index.html

xqd xqd
@@ -65,8 +65,8 @@
                 <button class="button button-clear" ng-click="closeClause()">关闭</button>
             </ion-header-bar>
             <ion-content>
-                <div style="margin: 15px; color: #666666;">
-                    <p>
+                <div style="margin: 15px; color: #666666;" ng-bind-html="info|trustHtml">
+                    <!-- <p>
                         欢迎使用瞄喵!
                     </p>
                     <p>
@@ -218,7 +218,7 @@
                     </p>
                     <p>
                         7.3瞄喵在法律允许的最大范围内对本协议拥有解释权与修改权。
-                    </p>
+                    </p> -->
                 </div>
             </ion-content>
         </div>

+ 29 - 0
miaomiao/www/templates/home/contact.html

xqd
@@ -0,0 +1,29 @@
+<ion-view view-title="举报" >
+    <ion-content>
+        <div class="addcontent list" style="color: #7B7B7B">
+            <div class="item">
+                举报<span style="color: #00c3da;">{{user_name}}</span>的"{{dream_name}}"
+            </div>
+            <div class="item">举报原因</div>
+            <div class="item itemjs">
+                <textarea rows="7" cols="50" ng-model="vm.content" style="border: 1px solid #D7D7D7;padding: 10px;width: 98%;"></textarea>
+            </div>
+            <div class="item">联系电话</div>
+            <div class="item item-input-inset itemjs">
+                <label class="item-input-wrapper" style="background: #fff; border: 1px solid #D7D7D7; margin: 0 12px 0 5px">
+                    <input type="text" ng-model="vm.email">
+                </label>
+            </div>
+        </div>
+        <div class="padding">
+            <div class="row">
+                <div class="col">
+                    <button type="submit"  class="button button-block button-calm" style="border-radius: 30px" ng-click="contact()">
+                        提交
+                    </button>
+                </div>
+            </div>
+        </div>
+    </ion-content>
+</ion-view>
+    

+ 1 - 1
miaomiao/www/templates/home/dream-detail.html

xqd
@@ -113,7 +113,7 @@
                             </div>
                         </div>
                     </div>
-                    <div class="item" style="padding:0 5px; border-top: 1px solid #E6E6E6;" ng-show="!isTest">
+                    <div class="item" style="padding:0 5px; border-top: 1px solid #E6E6E6;" ng-show="isTest">
                         <div class="row">
                             <div class="col" style="text-align:left">
                                 <h2>{{dream.coin}}</h2>

+ 1 - 1
miaomiao/www/templates/home/index.html

xqd
@@ -92,7 +92,7 @@
                                         <div class="col" style="text-align:right">
                                             <div style="margin-top:4px">
                                                 <img ng-src="img/icon_follow.svg" class="iheart">
-                                                <span style="color: #F16571">{{item.care_num}}</span>
+                                                <span style="color: #F16571">{{item.care_num + item.add_care_number}}</span>
                                                 <span>人关注</span>
                                             </div>
                                             <div class="mysecond">{{item.end_time | lastDate}}</div>

+ 1 - 1
miaomiao/www/templates/my/aboutMiao.html

xqd
@@ -1,5 +1,5 @@
 <ion-view view-title="关于瞄喵">
     <ion-content style="padding: 10%;color: #111;">
-       {{items.value}}
+        <div ng-bind-html="info|trustHtml"></div>
     </ion-content>
 </ion-view>

+ 1 - 1
miaomiao/www/templates/my/index.html

xqd
@@ -11,7 +11,7 @@
             
            <div class="row user-row">
                <div class="col"><i class="icon ion-heart"></i> 关注&nbsp;&nbsp;{{user.care_number}}</div>
-               <div class="col"><i class="icon ion-person"></i> 粉丝&nbsp;&nbsp;{{user.fans_number}}</div>
+               <div class="col"><i class="icon ion-person"></i> 粉丝&nbsp;&nbsp;{{user.fans_number + user.add_fens_number}}</div>
                <div class="col"><i class="icon ion-ios-film"></i> 梦想&nbsp;&nbsp;{{user.dreams_number}}</div>
            </div>
         </div>

+ 1 - 1
miaomiao/www/templates/my/my-recharge.html

xqd
@@ -15,7 +15,7 @@
                         <div>剩余梦想币</div>
                         <div class="re-num">{{vm.coin}}</div>
                     </div>
-                    <div ng-if="!ios.isIOS" class="col col-33" style="padding: 30px 0 0 20px;">
+                    <div ng-if="showWithdraw" class="col col-33" style="padding: 30px 0 0 20px;">
                         <a ng-click="withdraw()" style="border: 1px solid #00C3DA; color: #00C3DA; padding: 5px 25px; border-radius: 30px;">提现</a>
                     </div>
                 </div>