123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <template>
-
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import { getLogin } from "@/api/ajax";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: { },
- props: {},
- data() {
- //这里存放数据
- return {
-
- }
- },
- //计算属性 类似于data概念
- computed: {
- },
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
-
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- let MethodName = "/ShopServer/Client/ShareManager/GetShareRecordInfo";
- let data = {
- id: this.$route.query.share_id
- }
- getLogin(MethodName, data)
- .then((res) => {
- if(res.status===1){
- if(new Date().getTime()>new Date(res.share_record.share_time_end).getTime()){
- this.$message.error('链接已过期')
- return
- }
- localStorage.setItem('share_person_name',res.share_record.person_name)
- localStorage.setItem('share_person_touxiang',res.share_record.person_image_url)
- this.$router.replace({
- path: "/articleShareDetail",
- query: {
- id: res.share_record.goods_id
- },
- })
- }
- })
- .catch(() => {
- });
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- },
- //生命周期-创建之前
- beforeCreated() { },
- //生命周期-挂载之前
- beforeMount() { },
- //生命周期-更新之前
- beforUpdate() { },
- //生命周期-更新之后
- updated() { },
- //生命周期-销毁之前
- beforeDestory() { },
- //生命周期-销毁完成
- destoryed() { },
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() { }
- }
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- </style>
- <style lang="scss">
- </style>
|