File tree Expand file tree Collapse file tree 4 files changed +38
-4
lines changed
Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,17 @@ let api = {
282282 }
283283 )
284284 } ,
285+ clearLocation ( cb ) {
286+ axios . post ( '/apis/user/clearLocation' ) . then (
287+ ( ) => {
288+ cb ( true )
289+ } ,
290+ ( err ) => {
291+ console . error ( err )
292+ cb ( false )
293+ }
294+ )
295+ } ,
285296 createMessage ( { content, session} , cb ) {
286297 const message = {
287298 id : 'm_' + uuidv4 ( ) ,
Original file line number Diff line number Diff line change 11import VueI18n from 'vue-i18n'
22import Vue from 'vue'
3- import messages from '.. /locales'
3+ import messages from './locales'
44
55Vue . use ( VueI18n )
66
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ export default {
8080 upload : '上传' ,
8181 readFail : '读取图片失败' ,
8282 comingSoon : '敬请期待' ,
83- photoTooLarge : '图片太大'
83+ photoTooLarge : '图片太大' ,
84+ clearLocation : '清除位置信息'
8485 }
8586 } ,
8687 en : {
@@ -164,7 +165,8 @@ export default {
164165 upload : 'Upload' ,
165166 readFail : 'Read file fail' ,
166167 comingSoon : 'Coming soon' ,
167- photoTooLarge : 'Photo was too large'
168+ photoTooLarge : 'Photo was too large' ,
169+ clearLocation : 'Clear location'
168170 }
169171 }
170172}
Original file line number Diff line number Diff line change 44 <a href =" javascript:;" slot =" left" @click =" back" >
55 <mt-button icon =" back" >{{$t('msg.back')}}</mt-button >
66 </a >
7+ <mt-button icon =" more" slot =" right" @click.native =" sheetVisible = true" ></mt-button >
78 </mt-header >
89 <div class =" nearby-people-list" >
910 <mt-cell v-for =" (p, i) in nearbyPeoples" isLink :to =" (friendsInfo.hasOwnProperty(p.username) ? '/friendCard' : '/AddNearbyPeople') + '?friendName=' + p.username" :key =" i" :title =" p.username" :label =" formatDistance(p.distance)" @click.native =" " >
1213 </mt-cell >
1314 <div v-show =" nearbyPeoples.length === 0" class =" no-data" >{{ $t('msg.noData') }}</div >
1415 </div >
16+ <mt-actionsheet :actions =" [
17+ {
18+ name: this.$t('msg.clearLocation'),
19+ method: () => {
20+ this.handleClearLocation()
21+ }
22+ }
23+ ]"
24+ :cancelText =" $t('msg.cancel')"
25+ v-model =" sheetVisible" >
26+ </mt-actionsheet >
1527 </div >
1628</template >
1729<script >
1830 import {Toast , Indicator } from ' mint-ui'
1931 import {mapGetters } from ' vuex'
2032 import WcProfilePhoto from " ../components/ProfilePhoto"
33+ import api from ' ../api'
2134
2235 export default {
2336 name: ' wc-nearby-people' ,
2740 position: {
2841 latitude: - 1 ,
2942 longitude: - 1
30- }
43+ },
44+ sheetVisible: false
3145 }
3246 },
3347 computed: {
89103 return d .toFixed (2 ) + u + ' 以内'
90104 }
91105 return ' Within: ' + d .toFixed (2 ) + u
106+ },
107+ handleClearLocation () {
108+ api .clearLocation ((isOk ) => {
109+ if (isOk) {
110+ this .back ()
111+ }
112+ })
92113 }
93114 },
94115 mounted () {
You can’t perform that action at this time.
0 commit comments