diff --git a/common/js/mixins.js b/common/js/mixins.js new file mode 100644 index 0000000..bdfe885 --- /dev/null +++ b/common/js/mixins.js @@ -0,0 +1,15 @@ + +import { mapState } from 'vuex' + +export default { + computed: { + ...mapState({ + city: state=> state.user.vuex_cityInfo.city, + vuex_cityInfo: state=> state.user.vuex_cityInfo + }), + }, + data() { + return { + } + } +} \ No newline at end of file diff --git a/common/js/uniExport.js b/common/js/uniExport.js new file mode 100644 index 0000000..9f30b6a --- /dev/null +++ b/common/js/uniExport.js @@ -0,0 +1,8 @@ + +export let goPage = (url, params={}, type='navigateTo')=> { + uni.$u.route({ + url, + params, + type + }) + } \ No newline at end of file diff --git a/common/js/utils.js b/common/js/utils.js index 17ea3fd..c3c501a 100644 --- a/common/js/utils.js +++ b/common/js/utils.js @@ -76,6 +76,8 @@ const install = (Vue, vm) => { const day = date.getDate() return `${year}${splitor}${addZeroPrefix(month)}${splitor}${addZeroPrefix(day)}` } + + diff --git a/components/privacyPopup/privacyPopup.vue b/components/privacyPopup/privacyPopup.vue new file mode 100644 index 0000000..18e7578 --- /dev/null +++ b/components/privacyPopup/privacyPopup.vue @@ -0,0 +1,79 @@ + + + + + \ No newline at end of file diff --git a/components/privacyRadion/privacyRadion.vue b/components/privacyRadion/privacyRadion.vue new file mode 100644 index 0000000..dd065f0 --- /dev/null +++ b/components/privacyRadion/privacyRadion.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/main.js b/main.js index 4f59e28..0319b9f 100644 --- a/main.js +++ b/main.js @@ -2,10 +2,11 @@ import App from './App' import Vue from 'vue' import store from './store'; -// import config from "./utils/config.js" -// import {storage, goPage} from "./utils/utils.js" -// Vue.prototype.$config = config; -// Vue.prototype.$goPage = goPage; +import { goPage } from './common/js/uniExport.js' +Vue.prototype.$goPage = goPage; + +import mixin from "./common/js/mixins.js" +Vue.mixin(mixin) import './uni.promisify.adaptor' Vue.config.productionTip = false diff --git a/manifest.json b/manifest.json index 72ac63f..4344c67 100644 --- a/manifest.json +++ b/manifest.json @@ -52,15 +52,20 @@ "mp-weixin" : { "appid" : "wx2d71605af3b620e6", "setting" : { - "urlCheck" : false, - "es6" : true + "urlCheck": true, + "es6": true, + "postcss": true, + "minified": true }, "usingComponents" : true, "permission" : { "scope.userLocation" : { "desc" : "查询用户地理位置,推荐本地驾校,提高用户服务" } - } + }, + "requiredPrivateInfos": [ + "getLocation" + ] }, "mp-alipay" : { "usingComponents" : true diff --git a/pages.json b/pages.json index 425f69c..8d28d29 100644 --- a/pages.json +++ b/pages.json @@ -69,7 +69,7 @@ ], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "学车小程序", + "navigationBarTitleText": "", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, diff --git a/pages/tabbar/index/index.vue b/pages/tabbar/index/index.vue index 7fdd9a0..0338f62 100644 --- a/pages/tabbar/index/index.vue +++ b/pages/tabbar/index/index.vue @@ -1,15 +1,30 @@ diff --git a/pages/tabbar/mine/index.vue b/pages/tabbar/mine/index.vue index 05d501f..540ae37 100644 --- a/pages/tabbar/mine/index.vue +++ b/pages/tabbar/mine/index.vue @@ -1,6 +1,42 @@ @@ -26,6 +62,62 @@ diff --git a/pages/userCenter/login/login.vue b/pages/userCenter/login/login.vue index ea765d1..2667488 100644 --- a/pages/userCenter/login/login.vue +++ b/pages/userCenter/login/login.vue @@ -1,6 +1,27 @@ @@ -8,14 +29,48 @@ export default { data() { return { - + isCheck: false, + show: false, + decodePhoneParams: {} } }, onLoad() { - // this.init() - + this.getCode() + // uni.getLocation({ + // type: 'wgs84', + // success: function (res) { + // console.log(res) + // console.log('当前位置的经度:' + res.longitude); + // console.log('当前位置的纬度:' + res.latitude); + // } + // }); }, methods: { + // 获取code + getCode() { + uni.login({ + provider: 'weixin', + success: loginRes => { + this.decodePhoneParams.code = loginRes.code + console.log('loginRes') + console.log(loginRes) + } + }); + }, + // 获取手机号 + async getPhoneNumber(e) { + await this.getCode(); + console.log('获取手机号') + console.log(e) + if(!this.decodePhoneParams.code || !e.detail.encryptedData){ + return false; + } + + }, + // 是否选择协议 + changeRadio(val) { + this.isCheck = val + }, init() { uni.login({ provider: 'weixin', @@ -45,27 +100,68 @@ \ No newline at end of file diff --git a/pages/userCenter/login/loginByPhone.vue b/pages/userCenter/login/loginByPhone.vue index b700bce..429a9a4 100644 --- a/pages/userCenter/login/loginByPhone.vue +++ b/pages/userCenter/login/loginByPhone.vue @@ -1,10 +1,11 @@