JacquesLu 7 жил өмнө
parent
commit
ccf24c3d2a

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 237 - 237
sourcecode/h5app/vue/package-lock.json


+ 1 - 0
sourcecode/h5app/vue/package.json

@@ -15,6 +15,7 @@
     "vue-resource": "^1.5.1",
     "vue-router": "^3.0.2",
     "vue-toast-component": "^2.0.0",
+    "weixin-js-sdk": "^1.4.0-test",
     "whatwg-fetch": "^3.0.0"
   },
   "devDependencies": {

+ 91 - 92
sourcecode/h5app/vue/src/components/schoolCard.vue

@@ -1,93 +1,92 @@
-<template>
-    <div class="card" style="margin-bottom: 20px">
-        <van-row >
-            <van-col span="16">
-                <h3><strong>校卡审核</strong></h3>
-            </van-col>
-            <van-col span="8">
-               <p :style="{ color: statusColor[2] }">{{statusString[2]}}</p>
-            </van-col>
-        </van-row>
-        <add-photo @uploadPhoto="onReadPhoto"/>
-        <p>活动仅允许深大学生参与,请上传正面校卡照片审核~</p>
-
-
-    </div>
-</template>
-
-<script>
-    import {  Row, Col,  } from 'vant';
-    import AddPhoto from "../components/addPhoto";
-    import {BasicFunction} from "../connector/basic-service";
-    export default {
-        name: "schoolCard",
-        components: {
-            AddPhoto,
-            [Row.name]: Row, [Col.name]: Col,
-        },
-        data() {
-            return {
-                statusString: ['审核中', '未上传校卡', '审核通过', '审核失败'],
-                statusColor: ['#f43736', '#00ff00', '#00fa9a', '#ff0000'],
-                photo: null,
-            }
-        },
-        methods: {
-            publishPresent() {
-                // 检验输入
-
-                if (this.photo === null) {
-                    Toast.fail('请上传礼物照片');
-                    return;
-                }
-                // post_present()
-                let present = {
-                    photo: this.photo
-                };
-                console.log(present);
-                //FIXME : wrong address given !
-                BasicFunction.get_data("ajaxpostpresent", function (response) {
-                    console.log("------ Data Rcvd in School Card --------");
-                    console.log(response);
-                    if(response.ret === "10000"){
-                        // 不需要 设置 SessionID, 已经自动保存在jSessionID中
-                        this.$router.push('index');
-                    } else {
-                        // 注册失败的处理
-                        Toast.fail("上传失败,请检查网络");
-                    }
-                }, {});
-                // this.$router.push('index');
-            },
-            onReadPhoto(file) {
-                this.photo = file;
-            }
-        },
-        created: function () {
-            if (!localStorage.getItem('frontend-userid')) {
-                this.$router.push('login');
-                return;
-            }
-        }
-    }
-</script>
-
-<style scoped>
-    p, h3 {
-        color: #fd6740;
-    }
-    h3 {
-        padding: 5px;
-        border-bottom: solid 1px #e4e4e4;
-    }
-    p {
-        padding-top:  3px ;
-    }
-    .card {
-        background-color: white;
-        margin: 20px 20px;
-        border: solid 1px #e4e4e4;
-        padding: 15px;
-        text-align: left;
-    }
+<template>
+    <div class="card" style="margin-bottom: 20px">
+        <van-row style="border-bottom: solid 1px #e4e4e4;">
+            <van-col span="16">
+                <h3><strong>校卡审核</strong></h3>
+            </van-col>
+            <van-col span="8">
+               <p :style="{ color: statusColor[2] }">{{statusString[2]}}</p>
+            </van-col>
+        </van-row>
+        <add-photo @uploadPhoto="onReadPhoto"/>
+        <p>活动仅允许深大学生参与,请上传正面校卡照片审核~</p>
+
+
+    </div>
+</template>
+
+<script>
+    import {  Row, Col,  } from 'vant';
+    import AddPhoto from "../components/addPhoto";
+    import {BasicFunction} from "../connector/basic-service";
+    export default {
+        name: "schoolCard",
+        components: {
+            AddPhoto,
+            [Row.name]: Row, [Col.name]: Col,
+        },
+        data() {
+            return {
+                statusString: ['审核中', '未上传校卡', '审核通过', '审核失败'],
+                statusColor: ['#f43736', '#00ff00', '#00fa9a', '#ff0000'],
+                photo: null,
+            }
+        },
+        methods: {
+            publishPresent() {
+                // 检验输入
+
+                if (this.photo === null) {
+                    Toast.fail('请上传礼物照片');
+                    return;
+                }
+                // post_present()
+                let present = {
+                    photo: this.photo
+                };
+                console.log(present);
+                //FIXME : wrong address given !
+                BasicFunction.get_data("ajaxpostpresent", function (response) {
+                    console.log("------ Data Rcvd in School Card --------");
+                    console.log(response);
+                    if(response.ret === "10000"){
+                        // 不需要 设置 SessionID, 已经自动保存在jSessionID中
+                        this.$router.push('index');
+                    } else {
+                        // 注册失败的处理
+                        Toast.fail("上传失败,请检查网络");
+                    }
+                }, {});
+                // this.$router.push('index');
+            },
+            onReadPhoto(file) {
+                this.photo = file;
+            }
+        },
+        created: function () {
+            if (!localStorage.getItem('frontend-userid')) {
+                this.$router.push('login');
+                return;
+            }
+        }
+    }
+</script>
+
+<style scoped>
+    p, h3 {
+        color: #fd6740;
+    }
+    p,h3 {
+        padding: 5px;
+    }
+    p {
+        padding-top:  3px ;
+    }
+    .card {
+        background-color: white;
+        margin: 20px 20px;
+        border: solid 1px #e4e4e4;
+        padding: 15px;
+        text-align: left;
+    }
 </style>

+ 208 - 209
sourcecode/h5app/vue/src/components/schoolidCard.vue

@@ -1,210 +1,209 @@
-<template>
-    <div class="card" style="margin-bottom: 20px">
-        <van-row>
-            <van-col span="14">
-                <h3><strong>个人资料</strong></h3>
-            </van-col>
-            <van-col span="6" style="">
-                <p style="border-bottom: solid 1px #e4e4e4" @click="toggleReadOnly()">{{isReadonly ? "编辑" : "保存"}}</p>
-            </van-col>
-        </van-row>
-        <p>昵称</p>
-        <van-cell-group>
-            <van-field
-                    placeholder="请输入昵称"
-                    v-model="personName"
-                    :error="personError"
-                    @click="personError=false"
-                    required
-                    maxlength="10"
-                    :readonly="isReadonly"
-            />
-        </van-cell-group>
-        <p>性别</p>
-        <van-radio-group v-model="gender">
-            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">男</van-radio>
-            <van-radio name="1" checked-color="#fd6740" :disabled="isReadonly">女</van-radio>
-        </van-radio-group>
-        <p>微信号</p>
-        <van-cell-group>
-            <van-field
-                    placeholder=" "
-                    v-model="weixinName"
-                    :error="weixinError"
-                    @click="weixinError=false"
-                    required
-                    maxlength="20"
-                    :readonly="isReadonly"
-            />
-        </van-cell-group>
-        <p>宿舍区</p>
-            <van-radio-group v-model="dormDistrict">
-            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">南区</van-radio>
-            <van-radio name="1" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">西南</van-radio>
-            <van-radio name="2" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">斋区</van-radio>
-            <van-radio name="3" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">桂庙</van-radio>
-            <van-radio name="4" checked-color="#fd6740" :disabled="isReadonly">西丽</van-radio>
-        </van-radio-group>
-    </div>
-</template>
-
-<script>
-    import { Row, Col,
-        CellGroup, Field,
-        RadioGroup, Radio,
-        Toast
-    } from 'vant';
-    import {BasicFunction} from "../connector/basic-service";
-
-    export default {
-        name: "schoolidCard",
-        components: {
-
-            [CellGroup.name]: CellGroup, [Field.name]: Field,
-            [RadioGroup.name]: RadioGroup, [Radio.name]: Radio,
-            [Row.name]: Row, [Col.name]: Col,
-
-        },
-        data() {
-            return {
-                gender: '0',
-                dormDistrict: '1',
-                personName: '',
-                personError: false,
-                weixinName: '',
-                weixinError: false,
-                isReadonly: true,
-                userDo: {},
-                reviewDo: {},
-            }
-        },
-        methods: {
-            uploadNameChange: function () {
-                let that = this;
-                BasicFunction.get_data("smartUsers/updateBatch", function (response) {
-                    console.log("------ Data Rcvd in uploadNameChange --------");
-                    console.log(response);
-                    if (response.ret === "10000") {
-                        that.isReadonly = true;
-                        Toast.success("上传成功")
-                    } else {
-                        Toast.fail("上传失败,请检查网络");
-                    }
-                }, [this.userDo]);
-            },
-            uploadReviewChange: function () {
-                let that = this;
-                BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
-                    console.log("------ Data Rcvd in uploadReviewChange --------");
-                    console.log(response);
-                    if (response.ret === "10000") {
-                        //history.go(0);
-                        that.isReadonly = true;
-                        Toast.success("上传成功")
-                    } else {
-                        Toast.fail("上传失败,请检查网络");
-                    }
-                }, [this.reviewDo]);
-            },
-            toggleReadOnly: function () {
-                if (!this.isReadonly){
-                    this.savePage()
-                }
-                this.isReadonly =  !this.isReadonly;
-            },
-            savePage() {
-                // 检验输入
-                // var userId = localStorage.getItem(....
-                if (this.personName.length === 0) {
-                    this.personError = true;
-                    return;
-                } else if (this.weixinName.length >= 20) {
-                    this.weixinError = true;
-                    Toast.fail('最多输入20个字符');
-                    return;
-                }
-                // post_present()
-                this.userDo.name = this.personName;  // changed to personName instead.
-                this.uploadNameChange();
-                this.reviewDo.userSex = parseInt(this.gender); // TODO: 请注意 int <-> string 转换
-                this.reviewDo.dormDistrict = parseInt(this.dormDistrict);
-                this.uploadReviewChange();
-
-            },
-            getIdentityInfo: function (obj) {
-                //this;
-                if (!localStorage.getItem('frontend-userid')) {
-                    this.$router.push('login');
-                    return;
-                }
-                let userId = localStorage.getItem("frontend-userid");
-                let that = this;
-                BasicFunction.get_data("smartUsers/list?uid=" + userId, function (response) {
-                    console.log("------ Data Rcvd in getIdentityInfo --------");
-                    console.log(response);
-                    if (response.ret === "10000") {
-                        var t = response.model.list;
-                        that.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
-                        that.userDo = t[0];
-                    } else {
-                        // 注册失败的处理
-                        Toast.fail("获取失败,请检查网络");
-                    }
-                }, [{}]);
-            },
-            getReviewInfo:function (obj) {
-                if (!localStorage.getItem('frontend-userid')) {
-                    this.$router.push('login');
-                    return;
-                }
-                let userId = localStorage.getItem("frontend-userid");
-                let that = this;
-                BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (response) {
-                    console.log("------ Data Rcvd in getReviewInfo --------");
-                    console.log(response);
-                    if (response.ret === "10000") {
-                        var t = response.model.list;
-                        that.gender = ""+t[0].userSex; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
-                        that.dormDistrict = ""+t[0].dormDistrict; //TODO: 请注意文本数字转换
-                        that.reviewDo = t[0];
-                    } else {
-                        Toast.fail("获取失败,请检查网络");
-                    }
-                }, [{}]);
-            }
-        },
-
-        created: function () {
-            if (!localStorage.getItem('frontend-userid')) {
-                this.$router.push('login');
-                return;
-            }
-            let that = this;
-            this.getIdentityInfo(that);
-            this.getReviewInfo(that);
-        }
-    }
-</script>
-
-<style scoped>
-    p, h3 {
-        color: #fd6740;
-    }
-
-    h3 {
-        padding: 5px;
-        border-bottom: solid 1px #e4e4e4;
-    }
-
-    p {
-        padding-top: 3px;
-    }
-
-    .card {
-        background-color: white;
-        margin: 20px 20px;
-        border: solid 1px #e4e4e4;
-        padding: 15px;
-        text-align: left;
-    }
+<template>
+    <div class="card" style="margin-bottom: 20px">
+        <van-row style="border-bottom: solid 1px #e4e4e4;">
+            <van-col span="14">
+                <h3><strong>个人资料</strong></h3>
+            </van-col>
+            <van-col span="6" style="">
+                <p  @click="toggleReadOnly()">{{isReadonly ? "编辑" : "保存"}}</p>
+            </van-col>
+        </van-row>
+        <p>昵称</p>
+        <van-cell-group>
+            <van-field
+                    placeholder="请输入昵称"
+                    v-model="personName"
+                    :error="personError"
+                    @click="personError=false"
+                    required
+                    maxlength="10"
+                    :readonly="isReadonly"
+            />
+        </van-cell-group>
+        <p>性别</p>
+        <van-radio-group v-model="gender">
+            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">男</van-radio>
+            <van-radio name="1" checked-color="#fd6740" :disabled="isReadonly">女</van-radio>
+        </van-radio-group>
+        <p>微信号</p>
+        <van-cell-group>
+            <van-field
+                    placeholder=" "
+                    v-model="weixinName"
+                    :error="weixinError"
+                    @click="weixinError=false"
+                    required
+                    maxlength="20"
+                    :readonly="isReadonly"
+            />
+        </van-cell-group>
+        <p>宿舍区</p>
+            <van-radio-group v-model="dormDistrict">
+            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">南区</van-radio>
+            <van-radio name="1" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">西南</van-radio>
+            <van-radio name="2" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">斋区</van-radio>
+            <van-radio name="3" checked-color="#fd6740" style="float: left; margin-right: 20px" :disabled="isReadonly">桂庙</van-radio>
+            <van-radio name="4" checked-color="#fd6740" :disabled="isReadonly">西丽</van-radio>
+        </van-radio-group>
+    </div>
+</template>
+
+<script>
+    import { Row, Col,
+        CellGroup, Field,
+        RadioGroup, Radio,
+        Toast
+    } from 'vant';
+    import {BasicFunction} from "../connector/basic-service";
+
+    export default {
+        name: "schoolidCard",
+        components: {
+
+            [CellGroup.name]: CellGroup, [Field.name]: Field,
+            [RadioGroup.name]: RadioGroup, [Radio.name]: Radio,
+            [Row.name]: Row, [Col.name]: Col,
+
+        },
+        data() {
+            return {
+                gender: '0',
+                dormDistrict: '1',
+                personName: '',
+                personError: false,
+                weixinName: '',
+                weixinError: false,
+                isReadonly: true,
+                userDo: {},
+                reviewDo: {},
+            }
+        },
+        methods: {
+            uploadNameChange: function () {
+                let that = this;
+                BasicFunction.get_data("smartUsers/updateBatch", function (response) {
+                    console.log("------ Data Rcvd in uploadNameChange --------");
+                    console.log(response);
+                    if (response.ret === "10000") {
+                        that.isReadonly = true;
+                        Toast.success("上传成功")
+                    } else {
+                        Toast.fail("上传失败,请检查网络");
+                    }
+                }, [this.userDo]);
+            },
+            uploadReviewChange: function () {
+                let that = this;
+                BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
+                    console.log("------ Data Rcvd in uploadReviewChange --------");
+                    console.log(response);
+                    if (response.ret === "10000") {
+                        //history.go(0);
+                        that.isReadonly = true;
+                        Toast.success("上传成功")
+                    } else {
+                        Toast.fail("上传失败,请检查网络");
+                    }
+                }, [this.reviewDo]);
+            },
+            toggleReadOnly: function () {
+                if (!this.isReadonly){
+                    this.savePage()
+                }
+                this.isReadonly =  !this.isReadonly;
+            },
+            savePage() {
+                // 检验输入
+                // var userId = localStorage.getItem(....
+                if (this.personName.length === 0) {
+                    this.personError = true;
+                    return;
+                } else if (this.weixinName.length >= 20) {
+                    this.weixinError = true;
+                    Toast.fail('最多输入20个字符');
+                    return;
+                }
+                // post_present()
+                this.userDo.name = this.personName;  // changed to personName instead.
+                this.uploadNameChange();
+                this.reviewDo.userSex = parseInt(this.gender); // TODO: 请注意 int <-> string 转换
+                this.reviewDo.dormDistrict = parseInt(this.dormDistrict);
+                this.uploadReviewChange();
+
+            },
+            getIdentityInfo: function (obj) {
+                //this;
+                if (!localStorage.getItem('frontend-userid')) {
+                    this.$router.push('login');
+                    return;
+                }
+                let userId = localStorage.getItem("frontend-userid");
+                let that = this;
+                BasicFunction.get_data("smartUsers/list?uid=" + userId, function (response) {
+                    console.log("------ Data Rcvd in getIdentityInfo --------");
+                    console.log(response);
+                    if (response.ret === "10000") {
+                        var t = response.model.list;
+                        that.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                        that.userDo = t[0];
+                    } else {
+                        // 注册失败的处理
+                        Toast.fail("获取失败,请检查网络");
+                    }
+                }, [{}]);
+            },
+            getReviewInfo:function (obj) {
+                if (!localStorage.getItem('frontend-userid')) {
+                    this.$router.push('login');
+                    return;
+                }
+                let userId = localStorage.getItem("frontend-userid");
+                let that = this;
+                BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (response) {
+                    console.log("------ Data Rcvd in getReviewInfo --------");
+                    console.log(response);
+                    if (response.ret === "10000") {
+                        var t = response.model.list;
+                        that.gender = ""+t[0].userSex; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                        that.dormDistrict = ""+t[0].dormDistrict; //TODO: 请注意文本数字转换
+                        that.reviewDo = t[0];
+                    } else {
+                        Toast.fail("获取失败,请检查网络");
+                    }
+                }, [{}]);
+            }
+        },
+
+        created: function () {
+            if (!localStorage.getItem('frontend-userid')) {
+                this.$router.push('login');
+                return;
+            }
+            let that = this;
+            this.getIdentityInfo(that);
+            this.getReviewInfo(that);
+        }
+    }
+</script>
+
+<style scoped>
+    p, h3 {
+        color: #fd6740;
+    }
+
+    p,h3 {
+        padding: 5px;
+    }
+
+    p {
+        padding-top: 3px;
+    }
+
+    .card {
+        background-color: white;
+        margin: 20px 20px;
+        border: solid 1px #e4e4e4;
+        padding: 15px;
+        text-align: left;
+    }
 </style>

+ 1 - 0
sourcecode/h5app/vue/src/views/Assess.vue

@@ -41,6 +41,7 @@
         Toast
     } from 'vant'
     import {BasicFunction} from "../connector/basic-service";
+    // import { wx } from "http://res2.wx.qq.com/open/js/jweixin-1.4.0.js";
 
     export default {
         name: "Assess",

+ 80 - 6
sourcecode/h5app/vue/src/views/share.vue

@@ -1,39 +1,104 @@
-<template>
-    <div>
+<template >
+    <div class="note" :style="note">
         <!--分享页面-->
+        <div class="card">
+            <h3><strong>提交成功!最后一步</strong></h3>
+            <van-row>保存邀请卡片(图片)至手机</van-row>
+            <van-row>转发图片至朋友圈并截图</van-row>
+            <van-row>将截图发送至<span style="color: #F4A460"> 深大欢欢 </span>公众号后台,才可获得本次活动的【匹配资格】和【抽奖机会】</van-row>
+        </div>
         <div style="position: relative;">
             <img :src="share" style="max-width: 80%; position: relative;"/>
         </div>
         <van-button size="large" type="primary" @click="Toindex">返回首页</van-button>
+        <van-button size="large" type="primary" @click="ToShare">返回首页</van-button>
 
     </div>
 </template>
 
 <script>
-    import {
+  //  import wx from 'weixin-js-sdk';
+    import {Row, Col,
         Button
     } from 'vant'
     export default {
         name: "share",
         components: {
-            [Button.name]: Button
+            [Button.name]: Button,
+            [Row.name]: Row, [Col.name]: Col,
+            'wx': {
+                render(createElement) {
+                    return createElement(
+                        'script',
+                        {
+                            attrs: {
+                                type: 'text/javascript',
+                                src: 'http://res2.wx.qq.com/open/js/jweixin-1.4.0.js',
+                            },
+                        },
+                    );
+                },
+            },
+        },
+        mounted: {
+
         },
         data() {
             return {
+                note: {
+                    backgroundImage: "url(" + require("../assets/prize_background.jpg") + ")",
+                },
                 active: 0,
                 share: require('../assets/post.png'),
             }
         },
-        methods:{
-            Toindex(){
+        methods: {
+            Toindex() {
                 this.$router.push('index');
             }
+
         },
+
         created: function () {
             if (!localStorage.getItem('frontend-userid')) {
                 this.$router.push('login');
                 return;
             }
+
+            BasicFunction.getSigned(['onMenuShareTimeline', 'onMenuShareAppMessage',], function(){
+                wx.ready(function () {      //需在用户可能点击分享按钮前就先调用
+                    wx.onMenuShareTimeline({
+                        title: '用一份礼物,邂逅一段故事', // 分享标题
+                        link: 'https://gift.fogice.com/?res=timeline', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        imgUrl: 'http://gift.fogice.com/attachment/upload/2018-12-13_22-45-35_dbad3cb10afe017f8ef5158f96c9a7c6c622aa04db557384883f97fe38cae380.png', // 分享图标
+                        success: function () {
+                            // 设置成功
+                        }
+                    });
+                    wx.onMenuShareAppMessage({
+                        title: '用一份礼物,邂逅一段故事', // 分享标题
+                        desc: '嘿~我送出了一份圣诞礼物  要和我来交换吗', // 分享描述
+                        link: 'https://gift.fogice.com/?res=appmessage', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        imgUrl: 'http://gift.fogice.com/attachment/upload/2018-12-13_22-45-35_dbad3cb10afe017f8ef5158f96c9a7c6c622aa04db557384883f97fe38cae380.png', // 分享图标
+                        type: '', // 分享类型,music、video或link,不填默认为link
+                        dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+                        success: function () {
+// 用户点击了分享后执行的回调函数
+                        }
+                    });
+                })
+            });
+
+
+          /*  wx.config({
+                debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                appId: '', // 必填,公众号的唯一标识
+                timestamp:, // 必填,生成签名的时间戳
+                nonceStr: '', // 必填,生成签名的随机串
+                signature: '',// 必填,签名
+                jsApiList: [] // 必填,需要使用的JS接口列表
+            });*/
+
         }
     }
 </script>
@@ -45,4 +110,13 @@
         margin: 10px 0 10px;
         width: 55%;
     }
+    .card {
+        margin: 20px 20px;
+        padding: 15px;
+        text-align: left;
+    }
+    .van-row{
+
+        font-size: 0.3em;
+    }
 </style>

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно