|
@@ -3,6 +3,22 @@
|
|
|
<!-- 图书id{{bookid}} -->
|
|
|
<BookInfo :info='info'></BookInfo>
|
|
|
<!-- <button open-type='share' class="btn">转发给好友</button> -->
|
|
|
+ <div class="comment">
|
|
|
+ <textarea v-model="comment"
|
|
|
+ class="textarea"
|
|
|
+ :maxlength="100"
|
|
|
+ placeholder="请输入图书短评"></textarea>
|
|
|
+ <div class="location">
|
|
|
+ 地理位置:
|
|
|
+ <switch color="#EA5A49" @change="getGeo" :checked="location" />
|
|
|
+ <span class="text-primary">{{location}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="phone">
|
|
|
+ 手机型号:
|
|
|
+ <switch color="#EA5A49" @change="getPhone" :checked="phone"/>
|
|
|
+ <span class="text-primary">{{phone}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -15,10 +31,25 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
bookid: '',
|
|
|
- info: {}
|
|
|
+ info: {},
|
|
|
+ comment: '',
|
|
|
+ location: '',
|
|
|
+ phone: ''
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getGeo () {
|
|
|
+
|
|
|
+ },
|
|
|
+ getPhone(e) {
|
|
|
+ if(e.target.value) {
|
|
|
+ const res = wx.getSystemInfoSync();
|
|
|
+ // console.log(res.model);
|
|
|
+ this.phone = res.model;
|
|
|
+ } else {
|
|
|
+ this.phone = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
async getDetail () {
|
|
|
const info = await get('/weapp/bookdetail', {id: this.bookid})
|
|
|
wx.setNavigationBarTitle({
|
|
@@ -26,7 +57,7 @@ export default {
|
|
|
})
|
|
|
console.log(info)
|
|
|
this.info = info
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
onShareAppMessage: function(res) {
|
|
|
return {
|
|
@@ -58,5 +89,20 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-
|
|
|
+.comment {
|
|
|
+ margin-top: 10px;
|
|
|
+ .textarea {
|
|
|
+ width: 730px;
|
|
|
+ background-color: #eee;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .location {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 5px 10px;
|
|
|
+ }
|
|
|
+ .phone {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 5px 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|