Commit 48b29f24 48b29f2480dafa5c8dd14a28f79ff0c5539254c1 by zhanghao

commit

1 parent 6a44cde1
......@@ -127,27 +127,63 @@
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="createUserInfo" :model="createUserInfo" label-width="0px">
<el-form ref="createAPI" :model="createAPI" label-width="0px">
<el-card class="CadetBlue" shadow="always">
<div slot="header" class="clearfix">
<span>创建指定代理人的健康坊用户</span>
<span>生成接口请求参数</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="代理人手机号" v-model="createUserInfo.phone" clearable></el-input>
<el-input placeholder="请输入method" v-model="createAPI.method" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入biz_data" v-model="createAPI.biz_data" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入uid" v-model="createAPI.uid" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-input placeholder="该代理人名下的健康坊用户手机号" v-model="createUserInfo.agentPhone" clearable></el-input>
<el-input placeholder="请输入token" v-model="createAPI.token" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="">创建用户</el-button>
<el-button round @click="createApi">生成参数</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
<el-dialog
title="接口请求参数:"
:visible.sync="dialogCreateApi"
width="30%">
<span>{{myApi}}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogCreateApi = false">确 定</el-button>
</span>
</el-dialog>
</el-col>
<!-- <el-col :span="8">-->
<!-- <el-form ref="createUserInfo" :model="createUserInfo" label-width="0px">-->
<!-- <el-card class="CadetBlue" shadow="always">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>创建指定代理人的健康坊用户</span>-->
<!-- </div>-->
<!-- <div class="text item">-->
<!-- <el-form-item>-->
<!-- <el-input placeholder="代理人手机号" v-model="createUserInfo.phone" clearable></el-input>-->
<!-- </el-form-item>-->
<!-- <div style="margin: 15px 0;"></div>-->
<!-- <el-form-item>-->
<!-- <el-input placeholder="该代理人名下的健康坊用户手机号" v-model="createUserInfo.agentPhone" clearable></el-input>-->
<!-- </el-form-item>-->
<!-- <div style="margin: 15px 0;"></div>-->
<!-- <el-form-item>-->
<!-- <el-button round @click="">创建用户</el-button>-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- </el-card>-->
<!-- </el-form>-->
<!-- </el-col>-->
</el-row>
</div>
</template>
......@@ -242,7 +278,15 @@
createUserInfo: {
phone: '',
agentPhone: ''
}
},
createAPI: {
method: '',
biz_data: '',
uid: '5034720',
token: 'oVVeAl2eERPxiU1eY1LXf_nteJusfuDzYFQV3s0zhwRwQt1gyo-W13JiPaxE0msWRHSV_3cCrGXbdLUFZjHmJJrPWj4a1hYY2oTWgD2gbgelxZrHQ9D_U9ms-k7LX9Br8SeYfdhUJImw_x_YTEViMw=='
},
dialogCreateApi: false,
myApi: ''
// activityConfigRules: {
// id: [
// { required: true, message: '请输入活动ID', trigger: 'blur' }
......@@ -386,6 +430,30 @@
const {href} = this.$router.resolve({ name:'activityConfig', query:
{id: this.activityConfig.id, huangjing: this.activityConfig.huanjing.toString()}})
window.open(href, '_blank')
},
createApi() {
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/jiami?'+this.$qs.stringify({
method: this.createAPI.method,
biz_data: this.createAPI.biz_data,
uid: this.createAPI.uid,
token: this.createAPI.token
}),config).then((res)=>{
console.log(res);
this.myApi = res.data;
this.dialogCreateApi = true;
}).catch(error=>{
console.log(error);
this.$message({
showClose: true,
message: '服务器处理失败,请核对参数!',
type: 'error'
});
})
}
}
}
......