| | |
| | | */ |
| | | public function editDefault($business_card_id='') |
| | | { |
| | | $model=$this->get($business_card_id); |
| | | $model=$this->where(['business_card_id'=>$business_card_id])->find(); |
| | | //(new User())->where(['user_id'=>$model['user_id']])->update(['business_card_id' => $business_card_id]); |
| | | $this->where(['user_id' => $model['user_id']])->update(['is_default' => 0]); |
| | | return $model->save(['is_default' => 1]); |
| | |
| | | }, |
| | | getbusinessList() { |
| | | let _this = this; |
| | | _this._post('plus.business.business/getList', {user_id:uni.removeStorageSync('user_id')}, function(res) { |
| | | _this._post('plus.business.business/getList', { |
| | | user_id: uni.removeStorageSync('user_id') |
| | | }, function(res) { |
| | | _this.businessList = res.data.data; |
| | | if (_this.businessList.length > 0) { |
| | | _this.getbusiness(_this.businessList[_this.current].user_id) |
| | |
| | | }); |
| | | }, |
| | | |
| | | getStatistics() { |
| | | // 获取统计数据 |
| | | getStatistics(business_card_id) { |
| | | // 默认名片 |
| | | let _this = this; |
| | | _this._post('plus.business.business/getStatistics', {}, function(res) { |
| | | _this.statistics = res.data; |
| | | _this._post('plus.business.business/editDefault', { |
| | | business_card_id: business_card_id |
| | | }, function(res) { |
| | | _this.getbusinessList(); |
| | | _this.getVisitorList(); |
| | | }); |
| | | }, |
| | | getbusiness(user_id) { |
| | |
| | | }, |
| | | selectCard(index) { |
| | | this.current = index; |
| | | this.getCardStatistics(this.businessList[this.current].business_card_id); |
| | | this.getStatistics(this.businessList[this.current].business_card_id); |
| | | this.closePopup(); |
| | | }, |
| | | addNewCard() { |