Merge branch 'master' of http://git.zlxm286.com/r/companyProjecet
1 files added
4 files modified
| New file |
| | |
| | | <?php |
| | | |
| | | namespace app\branch\controller\position; |
| | | |
| | | use app\branch\controller\Controller; |
| | | use app\branch\model\position\Position as PositionModel; |
| | | |
| | | /** |
| | | * 职务管理控制器 |
| | | */ |
| | | class Position extends Controller |
| | | { |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | public function index() |
| | | { |
| | | // 列表 |
| | | $model = new PositionModel; |
| | | $list = $model->getAll(); |
| | | return $this->renderSuccess('', compact('list')); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | */ |
| | | public function add() |
| | | { |
| | | $model = new PositionModel; |
| | | // 新增记录 |
| | | if ($model->add($this->postData())) { |
| | | return $this->renderSuccess('添加成功'); |
| | | } |
| | | return $this->renderError($model->getError() ?: '添加失败'); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | */ |
| | | public function edit($position_id) |
| | | { |
| | | // 分类详情 |
| | | $model = PositionModel::detail($position_id); |
| | | // 更新记录 |
| | | if ($model->edit($this->postData())) { |
| | | return $this->renderSuccess('更新成功'); |
| | | } |
| | | return $this->renderError($model->getError() ?: '更新失败'); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | public function delete($position_id) |
| | | { |
| | | $model = PositionModel::detail($position_id); |
| | | if (!$model->remove()) { |
| | | return $this->renderError('该职务使用中,删除失败'); |
| | | } |
| | | return $this->renderSuccess('删除成功'); |
| | | } |
| | | |
| | | /** |
| | | * 开启禁止 |
| | | */ |
| | | public function status($position_id, $status) |
| | | { |
| | | // 商品详情 |
| | | $model = PositionModel::detail($position_id); |
| | | if (!$model->setStatus($status)) { |
| | | return $this->renderError('操作失败'); |
| | | } |
| | | return $this->renderSuccess('操作成功'); |
| | | } |
| | | } |
| | |
| | | return request._post('/branch/member.member/index', data, errorback); |
| | | }, |
| | | |
| | | /*添加成员*/ |
| | | addMember(data, errorback) { |
| | | return request._post('/branch/member.member/add', data, errorback); |
| | | }, |
| | | |
| | | /*分会待审核列表*/ |
| | | branchPendList(data, errorback) { |
| | | return request._post('/branch/branch.branch/apply', data, errorback); |
| | |
| | | return request._post('/branch/activity.file/delete', data, errorback); |
| | | }, |
| | | |
| | | /*获取职务*/ |
| | | positionList(data, errorback) { |
| | | return request._post('/branch/position.position/index', data, errorback); |
| | | }, |
| | | |
| | | /*分会设置*/ |
| | | branchSet(data, errorback) { |
| | | return request._get('/branch/setting.branch/index', data, errorback); |
| | |
| | | }, |
| | | created() { |
| | | /*获取列表*/ |
| | | this.getPosition(); |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { pay } from '@/common/pay.js'; |
| | | import PointsForm from './points'; // 积分选择弹窗 |
| | | export default { |
| | | components: { |
| | |
| | | activityData: {}, |
| | | isOpenPoints: false, // 是否打开积分弹窗 |
| | | validate: false, |
| | | payData: [], // 半屏小程序相关 |
| | | isFirst: false, |
| | | }; |
| | | }, |
| | | props: ['isOpenReg', 'in_radius'], |
| | | |
| | | onLoad() {}, |
| | | onShow() { |
| | | let self = this; |
| | | let options = wx.getEnterOptionsSync(); |
| | | // 从半屏小程序返回时执行 |
| | | if (options.scene == '1038' && self.isFirst == true) { |
| | | self.isFirst = false; |
| | | self.onPayResult(options.referrerInfo.extraData); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | // 半屏小程序返回 |
| | | onPayResult(e) { |
| | | let self = this; |
| | | self.loading = false; |
| | | uni.hideLoading(); |
| | | self.isFirst = false; |
| | | if (e.pay_result == 'success') { |
| | | self.paySuccess(self.payData); |
| | | } else { |
| | | if(self.order_id > 0){ |
| | | //兼容重新付款 |
| | | }else{ |
| | | self.payError(self.payData); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | paySuccess(result) { |
| | | let self = this; |
| | | self.showSuccess("支付成功", function() { |
| | | self.$emit('close', 1); |
| | | }) |
| | | |
| | | }, |
| | | payError(result) { |
| | | let self = this; |
| | | self.showSuccess("支付成功", function() { |
| | | self.$emit('close', 2); |
| | | }) |
| | | }, |
| | | |
| | | // 是否使用余额支付 |
| | | onUseBalance(e) { |
| | | if (e.target.value == true) { |
| | |
| | | in_radius: self.in_radius ? 1 : 0 // 如果为1,报名成功后直接签到 |
| | | }) |
| | | ) |
| | | }, function(result) { |
| | | }, function(res) { |
| | | uni.hideLoading(); |
| | | if (result.data.online_money) { |
| | | pay(result, self, function() { |
| | | |
| | | }, function() { |
| | | reg_success = 2; // 失败 |
| | | }); |
| | | } else if (result.code != 1) { |
| | | if (res.data.online_money) { |
| | | // 半屏小程序支付 by lyzflash |
| | | if (res.data.payment.is_embed) { |
| | | // console.log(res.data.payment); |
| | | self.isFirst = true; |
| | | uni.openEmbeddedMiniProgram({ |
| | | appId: res.data.payment.embed_app_id, |
| | | path: res.data.payment.embed_path, |
| | | extraData: res.data.payment.extraData, |
| | | envVersion: 'release', // develop开发版 trial体验版 release正式版 |
| | | success:function() { |
| | | console.log('打开半屏小程序成功'); |
| | | }, |
| | | fail:function() { |
| | | console.log('打开半屏小程序失败'); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | pay(res, self, self.paySuccess, self.payError); |
| | | } else if (res.code != 1) { |
| | | reg_success = 2; // 失败 |
| | | } |
| | | self.$emit('close', reg_success); |
| | |
| | | memberList(data, errorback) { |
| | | return request._post('/shop/branch.member/index', data, errorback); |
| | | }, |
| | | /*添加成员*/ |
| | | addMember(data, errorback) { |
| | | return request._post('/shop/branch.member/add', data, errorback); |
| | | }, |
| | | /*提现记录*/ |
| | | cashList(data, errorback) { |
| | | return request._post('/shop/branch.cash/index', data, errorback); |