浏览代码

change add photo border

StephenArk30 6 年之前
父节点
当前提交
977b14f305

+ 0 - 11
sourcecode/h5app/vue/src/App.vue

@@ -24,15 +24,4 @@
 body {
   background-color: #fff6e3;
 }
-
-.add_photo {
-  height: 100px;
-  width: 70%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  margin: 0 auto;
-  border-style: solid;
-  border-width: 1px;
-}
 </style>

二进制
sourcecode/h5app/vue/src/assets/declare_icons/1.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/2.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/3.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/4.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/exchange.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/info.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/share.png


二进制
sourcecode/h5app/vue/src/assets/declare_icons/upload.png


二进制
sourcecode/h5app/vue/src/assets/posts/1.png


二进制
sourcecode/h5app/vue/src/assets/posts/2.png


二进制
sourcecode/h5app/vue/src/assets/posts/3.png


二进制
sourcecode/h5app/vue/src/assets/posts/4.png


+ 19 - 5
sourcecode/h5app/vue/src/components/addPhoto.vue

@@ -1,12 +1,13 @@
 <template>
     <div class='add_photo'>
-        <img :src="photoURL" class="photo"/>
+        <img :src="photoURL" class="photo" name="photo"/>
         <input
                 type="file"
                 name="file"
                 accept="image/*"
                 class="photo"
-                @change="onRead"/>
+                @change="onRead"
+        />
     </div>
 </template>
 
@@ -32,18 +33,31 @@
                 };
                 this.$emit('onRead', f);
             }
-        }
+        },
     }
 </script>
 
 <style scoped>
     .photo {
-        width: 20%;
-        height: 70px;
+        max-height: 140px;
+        max-width: 50%;
         position: absolute;
     }
 
     [name='file'] {
         opacity: 0;
+        position: relative;
+        width: 100%;
+        height: 100%;
+    }
+
+    .add_photo {
+        height: 150px;
+        width: 70%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin: 0 auto;
+        border: dashed 1px #3e3e3e;
     }
 </style>

+ 3 - 2
sourcecode/h5app/vue/src/components/giftCard.vue

@@ -13,7 +13,7 @@
                 </van-row>
                 <van-row type="flex" justify="space-between">
                     <van-col class="c"><p>匹配性别</p></van-col>
-                    <van-col class="c"><p>{{gender ? '女' : '男'}}</p></van-col>
+                    <van-col class="c"><p>{{genders[gender]}}</p></van-col>
                 </van-row>
                 <van-row type="flex" justify="space-between">
                     <van-col class="c"><p>礼物状态</p></van-col>
@@ -53,7 +53,8 @@
             return {
                 place: ['南区', '斋区', '西南', '西丽'],
                 statusString: ['审核中', '匹配中', '匹配成功', '交换成功', '审核失败'],
-                statusColor: ['#fd6740', '#00ff00', '#00bfff', '#00fa9a', '#ff0000']
+                statusColor: ['#fd6740', '#00ff00', '#00bfff', '#00fa9a', '#ff0000'],
+                genders: ['未知', '男', '女']
             }
         },
         props: {

+ 1 - 1
sourcecode/h5app/vue/src/connector/simple-demo.js

@@ -186,7 +186,7 @@ smartGoods/saveBatch
 "goodsNo":"A2",
 "modelId":"1",
 "ownerId":"18", // 货品所有者id
-"goodFirstKind":"0", // 目标性别 男: 0,女: 1
+"goodFirstKind":"0", // 目标性别 未知: 0,男: 1,女: 2
 "goodSecondKind":"6", // 标签 0~13
 "sellPrice":"0.0",
 "marketPrice":"0.0",

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

@@ -124,6 +124,10 @@
         padding: 5px;
         border-bottom: solid 1px #e4e4e4;
     }
+
+    .assess {
+
+    }
     .card {
         background-color: white;
         margin: 20px 20px;

+ 132 - 76
sourcecode/h5app/vue/src/views/PresentRegister.vue

@@ -5,8 +5,8 @@
             <h3><strong>礼物匹配</strong></h3>
             <p>希望对方的性别是</p>
             <van-radio-group v-model="gender">
-                <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px">男</van-radio>
-                <van-radio name="1" checked-color="#fd6740">女</van-radio>
+                <van-radio name="1" checked-color="#fd6740" style="float: left; margin-right: 20px">男</van-radio>
+                <van-radio name="2" checked-color="#fd6740">女</van-radio>
             </van-radio-group>
             <p>礼物名称</p>
             <van-field
@@ -33,34 +33,42 @@
             </van-cell-group>
 
             <p>礼物标签</p>
-            <div style="margin-bottom: 20px">
-                <van-radio-group v-model="tag">
-                    <van-radio
-                            v-for="(item, index) in tags"
-                            :key="index"
-                            :name="index"
-                            checked-color="#fd6740"
-                            :style="(index+1) % 4 === 0 ? br : nobr">{{item}}
-                    </van-radio>
-                </van-radio-group>
-            </div>
+            <van-radio-group v-model="tag">
+                <div
+                        v-for="i in [0, 1 , 2, 3]"
+                        :key="i"
+                        style="height: 40px"
+                >
+                    <div
+                            v-for="j in [0, 1, 2, 3]"
+                            :key="j"
+                            style="float: left; width: 25%"
+                    >
+                        <van-radio
+                                v-if="i * 4 + j < tags.length"
+                                :name="i * 4 + j"
+                                checked-color="#fd6740"
+                        >{{tags[i * 4 + j]}}
+                        </van-radio>
+                    </div>
+                </div>
+            </van-radio-group>
 
         </div>
-        <div class="card" style="margin-bottom: 70px">
+        <div class="card" style="margin-bottom: 10px">
             <p>上传礼物照片</p>
-
             <div style="margin-bottom: 10px">
                 <add-photo :photoURL="imgUrl" @onRead="onRead"/>
-                <van-button
-                        type="primary"
-                        class="submit_button"
-                        @click="publishPresent"
-                        :loading="loading"
-                >下一步
-                </van-button>
             </div>
         </div>
 
+        <van-button
+                type="primary"
+                class="submit_button"
+                @click="publishPresent"
+                :loading="loading"
+        >下一步
+        </van-button>
     </div>
 </template>
 
@@ -91,7 +99,7 @@
         },
         data() {
             return {
-                gender: '0',
+                gender: '1',
                 presentId: '',
                 presentName: '',
                 pnError: false,
@@ -104,8 +112,6 @@
                 ],
                 tag: 0,
                 photo: null,
-                nobr: "float: left; margin-right: 5px",
-                br: "",
                 loading: false
             }
         },
@@ -134,52 +140,106 @@
 
                 console.log('------- photo -------');
                 console.log(this.photo);
-                let formData = new FormData();
-                formData.append('file', this.photo);
-                let imgURL = '';
-                let that = this;
-                BasicFunction.get_data("fileserver/upload?sign=abcdefg", function (res) {
-                    console.log('----- upload photo result -----');
-                    console.log(res);
-                    if (res.ret === '10000') {
-                        imgURL = res.model;
-                        console.log('img:' + imgURL);
-                        let present = [{
-                            goodid: that.presentId,
-                            name: that.presentName,
-                            goodsNo: "0", modelId: "0",
-                            ownerId: userId.toString(),
-                            goodFirstKind: gender,
-                            goodSecondKind: tag.toString(),
-                            sellPrice: "0.0", marketPrice: "0.0", costPrice: "0.0",
-                            upTime: getNowFormatDate(), downTime: getNowFormatDate(), createTime: getNowFormatDate(),
-                            storeNums: "0",
-                            img: imgURL,
-                            isDel: "0", content: "none", keywords: "none",
-                            description: that.desc,
-                            searchWords: "", weight: "0.0", point: "0", unit: "0", brandId: "0",
-                            visit: "0", favorite: "0", sort: "0", listImg: "xx.jpg",
-                            smallImg: "xx.jpg", specArray: "{}", exp: "0"
-                        }];
-                        console.log(present);
-                        let url = "updateBatch";
-                        if (that.presentId === '') url = "saveBatch";
-                        BasicFunction.get_data("smartGoods/" + url, function (response) {
-                            console.log("------ Data Rcvd in PresentReg --------");
-                            console.log(response);
-                            if (response.ret === "10000") {
-                                that.$router.push('share');
-                            } else {
-                                Toast.fail("上传失败,请检查网络");
-                                that.loading = false;
-                            }
-                        }, present);
-                    } else {
-                        Toast.fail('上传图片失败,请检查网络');
-                        that.loading = false;
-                    }
-                }, formData);
 
+                let that = this;
+                // 如果没有改变图片,直接上传
+                if (this.imgUrl && this.imgUrl === this.photo) {
+                    let imgURL = this.imgUrl;
+                    imgURL = '/' + imgURL.split('/')[3] + '/' + imgURL.split('/')[4] + '/' + imgURL.split('/')[5];
+                    let present = [{
+                        goodid: this.presentId,
+                        name: this.presentName,
+                        goodsNo: "0", modelId: "0",
+                        ownerId: userId.toString(),
+                        goodFirstKind: gender,
+                        goodSecondKind: tag.toString(),
+                        sellPrice: "0.0", marketPrice: "0.0", costPrice: "0.0",
+                        upTime: getNowFormatDate(), downTime: getNowFormatDate(), createTime: getNowFormatDate(),
+                        storeNums: "0",
+                        img: imgURL,
+                        isDel: "0", content: "none", keywords: "none",
+                        description: that.desc,
+                        searchWords: "", weight: "0.0", point: "0", unit: "0", brandId: "0",
+                        visit: "0", favorite: "0", sort: "0", listImg: "xx.jpg",
+                        smallImg: "xx.jpg", specArray: "{}", exp: "0"
+                    }];
+                    console.log(present);
+                    let url = "updateBatch";
+                    if (that.presentId === '') url = "saveBatch";
+                    BasicFunction.get_data("smartGoods/" + url, function (response) {
+                        console.log("------ Data Rcvd in PresentReg --------");
+                        console.log(response);
+                        if (response.ret === "10000") {
+                            that.$router.push('share');
+                        } else {
+                            Toast.fail("上传失败,请检查网络");
+                            that.loading = false;
+                        }
+                    }, present);
+                }
+                else {
+                    let formData = new FormData();
+                    formData.append('file', this.photo);
+                    let imgURL = '';
+                    // 先上传图片
+                    BasicFunction.get_data("fileserver/upload?sign=abcdefg", function (res) {
+                        console.log('----- upload photo result -----');
+                        console.log(res);
+                        if (res.ret === '10000') {
+                            imgURL = res.model;
+                            console.log('img:' + imgURL);
+                            let present = [{
+                                goodid: that.presentId,
+                                name: that.presentName,
+                                goodsNo: "0",
+                                modelId: "0",
+                                ownerId: userId.toString(),
+                                goodFirstKind: gender,
+                                goodSecondKind: tag.toString(),
+                                sellPrice: "0.0",
+                                marketPrice: "0.0",
+                                costPrice: "0.0",
+                                upTime: getNowFormatDate(),
+                                downTime: getNowFormatDate(),
+                                createTime: getNowFormatDate(),
+                                storeNums: "0",
+                                img: imgURL,
+                                isDel: "0",
+                                content: "none",
+                                keywords: "none",
+                                description: that.desc,
+                                searchWords: "",
+                                weight: "0.0",
+                                point: "0",
+                                unit: "0",
+                                brandId: "0",
+                                visit: "0",
+                                favorite: "0",
+                                sort: "0",
+                                listImg: "xx.jpg",
+                                smallImg: "xx.jpg",
+                                specArray: "{}",
+                                exp: "0"
+                            }];
+                            console.log(present);
+                            let url = "updateBatch";
+                            if (that.presentId === '') url = "saveBatch";
+                            BasicFunction.get_data("smartGoods/" + url, function (response) {
+                                console.log("------ Data Rcvd in PresentReg --------");
+                                console.log(response);
+                                if (response.ret === "10000") {
+                                    that.$router.push('share');
+                                } else {
+                                    Toast.fail("上传失败,请检查网络");
+                                    that.loading = false;
+                                }
+                            }, present);
+                        } else {
+                            Toast.fail('上传图片失败,请检查网络');
+                            that.loading = false;
+                        }
+                    }, formData);
+                }
             },
             onRead: function (e) {
                 this.photo = e;
@@ -195,11 +255,12 @@
                 console.log('----- Present Info -----');
                 console.log(present);
                 this.presentId = present.id;
-                this.radio = present.gender.toString();
+                this.gender = present.gender.toString();
                 this.presentName = present.name;
                 this.desc = present.desc_long;
                 this.tag = present.tags;
                 this.imgUrl = present.imgUrl;
+                this.photo = present.imgUrl;
             }
         }
     }
@@ -249,15 +310,10 @@
         padding: 15px;
         text-align: left;
     }
-
     .submit_button {
         margin-bottom: 10px;
         margin-left: auto;
         margin-right: auto;
-        position: fixed;
-        bottom: 0;
-        left: 0;
-        right: 0;
         background-color: #fd6740;
         border-color: #fd6740;
         width: 85%;

+ 12 - 16
sourcecode/h5app/vue/src/views/SecurityVerify.vue

@@ -49,8 +49,8 @@
 
             <p>性别</p>
             <van-radio-group v-model="radio">
-                <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px">男</van-radio>
-                <van-radio name="1" checked-color="#fd6740">女</van-radio>
+                <van-radio name="1" checked-color="#fd6740" style="float: left; margin-right: 20px">男</van-radio>
+                <van-radio name="2" checked-color="#fd6740">女</van-radio>
             </van-radio-group>
 
             <p>宿舍区</p>
@@ -61,23 +61,23 @@
                     cancel-text="取消"
                     @select="onSelect"
             />
-
         </div>
 
-        <div class="card" style="margin-bottom: 70px">
+        <div class="card" style="margin-bottom: 10px">
             <p>上传校卡照片</p>
             <div style="margin-bottom: 10px">
                 <add-photo @onRead="onRead"/>
-                <van-button
-                        class="submit_button"
-                        type="primary"
-                        @click="next"
-                        :loading="loading"
-                >下一步
-                </van-button>
             </div>
             <p>活动仅允许深大学生参与,请上传正面校卡照片审核~</p>
         </div>
+
+        <van-button
+                class="submit_button"
+                type="primary"
+                @click="next"
+                :loading="loading"
+        >下一步
+        </van-button>
     </div>
 </template>
 
@@ -115,7 +115,7 @@
                 usernameError: false,
                 wechat: '',
                 wechatError: false,
-                radio: '0',
+                radio: '1',
                 show: false,
                 dormitory: '点击选择宿舍区',
                 dorId: -1,
@@ -264,10 +264,6 @@
         margin-bottom: 10px;
         margin-left: auto;
         margin-right: auto;
-        position: fixed;
-        bottom: 0;
-        left: 0;
-        right: 0;
         background-color: #fd6740;
         border-color: #fd6740;
         width: 85%;

+ 52 - 8
sourcecode/h5app/vue/src/views/index.vue

@@ -1,11 +1,15 @@
 <template>
     <div>
         <guide style="z-index: 3" v-if="hasPresent === false"/>
-        <van-swipe :autoplay="3000" style="margin: 10px 10px;">
+        <van-swipe :autoplay="3000" style="margin: 10px 10px;" :initial-swipe="1">
             <van-swipe-item v-for="(image, index) in images" :key="index">
-                <img v-lazy="image" style="max-width: 100%"/>
+                <img v-lazy="image" style="width: 100%"/>
             </van-swipe-item>
         </van-swipe>
+        <van-notice-bar
+                text="上传礼物的截止时间是24号21:00,25号0点开始将陆续放出配对结果,请留意"
+                left-icon="//img.yzcdn.cn/vant/volume.png"
+        />
 
         <van-row type="flex" justify="space-between" align="center" style="margin: 0 10px 0 15px">
             <van-col>
@@ -31,11 +35,20 @@
         </ul>
         <div style="margin: 50px 10px;">
             <p style="text-align: left; margin-left: 5px"><strong>简单四步,轻松互赠圣诞礼物</strong></p>
-            <img
-                    src="../assets/declare_icons/declare.jpg"
-                    style="margin-bottom: 40px"
+            <!--<img-->
+            <!--src="../assets/declare_icons/declare.jpg"-->
+            <!--style="margin-bottom: 40px"-->
+            <!--@click="$router.push('verify')"-->
+            <!--/>-->
+            <div
+                    class="dec"
+                    v-for="(pic, index) in dec_icons"
+                    :key="index"
                     @click="$router.push('verify')"
-            />
+            >
+                <img :src="pic"/>
+                <p>{{dec_words[index]}}</p>
+            </div>
         </div>
         <add-present-button :can_add="button_active"/>
     </div>
@@ -45,7 +58,8 @@
     import IndexPresent from "../components/IndexPresent";
     import {
         Button, Row, Col,
-        Swipe, SwipeItem
+        Swipe, SwipeItem,
+        NoticeBar
     } from "vant";
     import AddPresentButton from "../components/addPresentButton";
     import {BasicFunction} from '../connector/basic-service';
@@ -60,6 +74,7 @@
             [Button.name]: Button,
             [Row.name]: Row, [Col.name]: Col,
             [Swipe.name]: Swipe, [SwipeItem.name]: SwipeItem,
+            [NoticeBar.name]: NoticeBar
         },
         data() {
             return {
@@ -71,7 +86,19 @@
                 active: 0,
                 button_active: true,
                 presents: {},
-                hasPresent: false
+                hasPresent: false,
+                dec_icons: [
+                    require('../assets/declare_icons/1.png'),
+                    require('../assets/declare_icons/2.png'),
+                    require('../assets/declare_icons/3.png'),
+                    require('../assets/declare_icons/4.png'),
+                ],
+                dec_words: [
+                    '填写资料',
+                    '上传礼物',
+                    '获得匹配',
+                    '线下交换'
+                ]
             }
         },
         methods: {
@@ -135,5 +162,22 @@
 </script>
 
 <style scoped>
+    .dec {
+        float: left;
+        width: 25%;
+    }
 
+    .dec img {
+        width: 50%;
+        background-color: white;
+        border-radius: 50%;
+        padding: 5px;
+        margin-bottom: 0;
+    }
+
+    .dec p {
+        font-size: 80%;
+        margin-top: 2px;
+        color: #9e9e9e;
+    }
 </style>