Browse Source

fix: 完善分享功能

develop
song 4 years ago
parent
commit
7d79fb7492
  1. 3
      CHANGELOG.md
  2. 3
      src/App.vue
  3. 1
      src/pagesProject/project/project.vue
  4. 58
      src/pagesUser/git-phone-power/git-phone-power.vue
  5. 44
      src/pagesUser/phone-bind/phone-bind.vue
  6. 9
      src/store/yanyuan/mutations.js
  7. 1
      src/store/yanyuan/state.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-12-27)
# 0.1.0 (2021-12-28)
### 🌟 新功能
范围|描述|commitId
@ -170,6 +170,7 @@
- | 初始展示角色修改 | [2ac4053](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2ac4053)
- | 卸载stylus | [610b465](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/610b465)
- | 多处bug修改 | [4835581](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4835581)
- | 完善分享功能 | [dab9e65](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/dab9e65)
- | 完善扫描二维码逻辑 | [41421ba](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/41421ba)
- | 完善扫描二维码逻辑 | [658245f](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/658245f)
- | 完善雷达图 | [5f52d35](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/5f52d35)

3
src/App.vue

@ -9,6 +9,7 @@ export default {
// TODO: this
console.log('options: ', options);
this.setScene(options.scene);
this.setEnterOptions(options);
if (options.scene === 1047) {
//
if (options.query && options.query.scene) {
@ -53,7 +54,7 @@ export default {
...mapActions('socket', ['initSocket']),
...mapMutations(['setSystemInfo']),
...mapMutations('user', ['setToken', 'setUser']),
...mapMutations('yanyuan', ['setToolCode', 'setEnterByCode', 'setScene']),
...mapMutations('yanyuan', ['setToolCode', 'setEnterByCode', 'setScene', 'setEnterOptions']),
//
async signin() {

1
src/pagesProject/project/project.vue

@ -79,6 +79,7 @@ export default {
},
onLoad(options) {
console.log('options: ', options);
this.templateCode = options.code;
if (options.share && options.share === '1') {
// TODO:

58
src/pagesUser/git-phone-power/git-phone-power.vue

@ -54,7 +54,7 @@ export default {
computed: {
...mapGetters('user', ['userId']),
...mapState('yanyuan', ['enterByCode']),
...mapState('yanyuan', ['enterByCode', 'enterOptions', 'scene']),
},
mounted() {
@ -91,15 +91,9 @@ export default {
this.$refs.uTips.show({
title: '绑定成功, 即将跳转',
type: 'success',
duration: '2000',
duration: '3000',
});
let url = '';
if (this.enterByCode) {
url = `/pages/index/index?u=${this.userId}&code=true`;
} else {
url = `/pages/index/index?u=${this.userId}`;
}
setTimeout(() => uni.reLaunch({ url }), 2000);
this.JumpPage();
} else {
this.phone = data.phone;
}
@ -136,26 +130,14 @@ export default {
type: 'success',
duration: '3000',
});
let url = '';
if (this.enterByCode) {
url = `/pages/index/index?u=${this.userId}&code=true`;
} else {
url = `/pages/index/index?u=${this.userId}`;
}
setTimeout(() => uni.reLaunch({ url }), 3000);
this.JumpPage();
} else {
this.$refs.uTips.show({
title: '即将跳转上一页',
type: 'success',
duration: '3000',
});
let url = '';
if (this.enterByCode) {
url = `/pages/index/index?u=${this.userId}&code=true`;
} else {
url = `/pages/index/index?u=${this.userId}`;
}
setTimeout(() => uni.reLaunch({ url }), 3000);
this.JumpPage();
}
} catch (error) {
console.error('error: ', error);
@ -167,7 +149,6 @@ export default {
//
back() {
let url = '';
console.log('this.enterByCode: ', this.enterByCode);
if (this.enterByCode) {
url = `/pages/index/index?u=${this.userId}&code=true`;
} else {
@ -175,6 +156,35 @@ export default {
}
uni.reLaunch({ url });
},
//
JumpPage() {
if (this.enterByCode) {
let url = `/pages/index/index?u=${this.userId}&code=true`;
setTimeout(() => uni.reLaunch({ url }), 3000);
} else {
if (this.scene === 1007 || (this.scene === 1008 && this.enterOptions.path === 'pagesProject/project/project')) {
this.enterProject();
} else {
let url = `/pages/index/index?u=${this.userId}`;
setTimeout(() => uni.reLaunch({ url }), 3000);
}
}
},
//
enterProject() {
const { userId } = this;
const { path, query } = this.enterOptions;
const { code, p, pname, url, u } = query;
this.$u.route(`/${path}`, {
u: userId || u,
p,
pname: pname,
url: encodeURIComponent(url),
code,
});
},
},
};
</script>

44
src/pagesUser/phone-bind/phone-bind.vue

@ -47,7 +47,7 @@
</template>
<script>
import { mapMutations } from 'vuex';
import { mapMutations, mapGetters, mapState } from 'vuex';
import { ImageCode } from './components/ImageCode/ImageCode';
export default {
@ -104,6 +104,12 @@ export default {
onReady() {
this.$refs.uForm.setRules(this.rules);
},
computed: {
...mapGetters('user', ['userId']),
...mapState('yanyuan', ['enterByCode', 'enterOptions', 'scene']),
},
methods: {
...mapMutations('user', ['setToken', 'setUser']),
@ -120,10 +126,7 @@ export default {
type: 'success',
duration: '3000',
});
setTimeout(() => {
// uni.navigateBack();
uni.redirectTo({ url: '/pages/index/index' });
}, 2000);
this.JumpPage();
} catch (error) {
/* this.$refs.uTips.show({
title: error.msg || '手机号绑定失败',
@ -224,12 +227,41 @@ export default {
type: 'success',
duration: '3000',
});
setTimeout(() => uni.redirectTo({ url: '/pages/index/index' }), 2000);
this.JumpPage();
} catch (error) {
this.$t.ui.showToast(error.msg || '手机号合并失败');
}
this.mergePop = false;
},
//
JumpPage() {
if (this.enterByCode) {
let url = `/pages/index/index?u=${this.userId}&code=true`;
setTimeout(() => uni.reLaunch({ url }), 3000);
} else {
if (this.scene === 1007 || (this.scene === 1008 && this.enterOptions.path === 'pagesProject/project/project')) {
this.enterProject();
} else {
let url = `/pages/index/index?u=${this.userId}`;
setTimeout(() => uni.reLaunch({ url }), 3000);
}
}
},
//
enterProject() {
const { userId } = this;
const { path, query } = this.enterOptions;
const { code, p, pname, url } = query;
this.$u.route(`/${path}`, {
u: userId,
p,
pname: pname,
url: encodeURIComponent(url),
code,
});
},
},
};
</script>

9
src/store/yanyuan/mutations.js

@ -169,6 +169,15 @@ const mutations = {
setScene(state, data) {
state.scene = data;
},
/**
* 设置进入options
* @param {object} state
* @param {object} data
*/
setEnterOptions(state, data) {
state.enterOptions = data;
},
};
export default mutations;

1
src/store/yanyuan/state.js

@ -19,6 +19,7 @@ const state = {
toolCode: '', // 二维码携带的工具箱code
testNumber: 0, // 已经完成的试题编号
scene: '', // 场景值
enterOptions: null, // 进入程序options
};
export default state;

Loading…
Cancel
Save