Browse Source

fix: 分享项目链接

wrr
song 4 years ago
parent
commit
d8672398ca
  1. 1
      CHANGELOG.md
  2. 6
      rest/project.http
  3. 3
      src/App.vue
  4. 4
      src/components/Title/Title.vue
  5. 7
      src/components/Title/components/ShareProject.vue
  6. 5
      src/pages/project/project.vue

1
CHANGELOG.md

@ -82,6 +82,7 @@
- | 修改角色样式 | [73e268e](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/73e268e)
- | 修改选择检查人样式 | [4c2de55](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/4c2de55)
- | 删除calendar中多余的console | [e339eec](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/e339eec)
- | 删除console.log | [a9ead1a](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/a9ead1a)
- | 删除console.log | [5064a38](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/5064a38)
- | 删除index中没用的alert代码 | [9c9eec7](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/9c9eec7)
- | 删除mock,console;upload添加loading | [99d42e2](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/99d42e2)

6
rest/project.http

@ -1,14 +1,14 @@
### login
# @name login
POST https://www.tall.wiki/gateway/tall/v1.0/users/signin
POST https://test.tall.wiki/gateway/tall/v1.0/users/signin
content-type: application/json;charset=utf-8
{
"client": 1,
"data": {
"credential": "999999",
"identifier": "song"
"credential": "123456",
"identifier": "mazhuang"
},
"scene": 0,
"type": 3

3
src/App.vue

@ -3,7 +3,6 @@ import { mapActions, mapMutations, mapState, mapGetters } from 'vuex';
export default {
async onLaunch(options) {
console.log('options: ', options);
this.checkNetwork(); //
/* #ifdef MP-WEIXIN */
@ -19,7 +18,7 @@ export default {
if (!options.query.share) {
if (!options.query || !options.query.u) {
// u (userId)
this.$t.ui.showToast(`缺少用户信息参数+${options.query.share}`);
this.$t.ui.showToast('缺少用户信息参数');
} else {
const data = await this.getToken(options.query.u);
this.noPhone(data.phone);

4
src/components/Title/Title.vue

@ -117,9 +117,9 @@ export default {
},
//
openIndex() {
this.$u.route('/pages/index/index', { u: this.userId });
console.log(this.$route);
uni.redirectTo({ url: `/pages/index/index?u=${this.userId}` });
},
//
operation() {
// this.$t.ui.showToast('');

7
src/components/Title/components/ShareProject.vue

@ -21,7 +21,7 @@
<u-button
style="border-radius: 0; height: 100%"
type="primary"
v-clipboard:copy="links"
v-clipboard:copy="copyText"
v-clipboard:success="copySuccess"
v-clipboard:error="copyError"
>
@ -68,7 +68,9 @@ export default {
allRolesName: [],
index: 0,
links: '', //
copyText: '',
checked: false, //
roleName: '观众',
//
list: [
{
@ -103,6 +105,7 @@ export default {
computed: {
...mapState('role', ['visibleRoles', 'invisibleRoles']),
...mapState('project', ['project']),
...mapGetters('project', ['projectId']),
},
@ -133,6 +136,7 @@ export default {
//
async changeRole(e) {
this.index = e.target.value;
this.roleName = this.allRolesName[this.index].name;
const { path, projectId } = this;
const params = { path, projectId, roleId: this.allRolesName[this.index].id };
await this.creatShare(params);
@ -157,6 +161,7 @@ export default {
try {
const data = await this.$u.api.createShare(params);
this.links = data.path;
this.copyText = `邀请您加入${this.project.name}的项目,角色为${this.roleName},链接为${data.path}&url=${this.$t.domain}`;
} catch (error) {
console.error('error: ', error);
}

5
src/pages/project/project.vue

@ -37,6 +37,7 @@ export default {
},
onLoad(options) {
console.log('options: ', options);
if (options.share && options.share === '1') {
this.shareInit(options);
} else {
@ -286,7 +287,7 @@ export default {
// tokenuserIdtoken
// token userId
if (!options || !options.u) {
this.$t.ui.showToast('缺少用户信息参数2'); // u (userId)
this.$t.ui.showToast('缺少用户信息参数'); // u (userId)
} else {
this.getToken(options.u);
}
@ -296,7 +297,7 @@ export default {
options && options.pname && this.setProjectName(options.pname);
if (!options || !options.p) {
this.$t.ui.showToast('缺少项目信息参数3'); // id
this.$t.ui.showToast('缺少项目信息参数'); // id
} else {
this.getProjectById({ projectId: options.p }); // id
}

Loading…
Cancel
Save