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 @@
+
-
+
- 南昌市
+ {{ vuex_cityInfo.city }}
@@ -23,7 +38,8 @@
-
+
@@ -53,9 +69,10 @@
-
-
+
+
@@ -90,60 +107,131 @@
-
+
+
+
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 @@
-
- 我的
+
+
+
+
+ Hi,大乔
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 我的预约
+
+
+
+
+ 业务办理
+
+
+
+
+
+ 学时查询
+
+
+
@@ -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 @@
-
+
+
短信验证码登录
@@ -26,13 +27,8 @@
{{codeText}}
登 录
-
-
-
-
-
- 《用户协议》和 《隐私协议》
-
+
+
@@ -46,7 +42,8 @@
isCheck: false,
codeText: '获取验证码',
FormData: {},
- codeOn: false
+ codeOn: false,
+ bgColor: 'transparent'
}
},
onLoad() {
@@ -61,10 +58,12 @@
}
},
methods: {
+ leftClick() {
+ console.log('leftClick');
+ },
// 是否选择协议
- groupChangeEnvnt(e) {
- this.isCheck = e.value
- console.log('是否选择协议', this.isCheck)
+ changeRadio(val) {
+ this.isCheck = val
},
// 发送短信验证码
async goSms() {
@@ -118,7 +117,7 @@
.title {
font-size: 48rpx;
color: #333;
- padding: 92rpx 0;
+ padding: 202rpx 0 80rpx 0;
text-align: center;
font-weight: 600;
}
@@ -170,18 +169,7 @@
}
}
- .radioWrap {
- display: flex;
- align-items: center;
- margin-top: 40rpx;
- .privacyText {
- font-size: 24rpx;
- color: #888E94;
- text {
- color: $themC;
- }
- }
- }
+
}
}
\ No newline at end of file
diff --git a/static/images/bigImg/topbg.png b/static/images/bigImg/topbg.png
new file mode 100644
index 0000000..a6333fa
Binary files /dev/null and b/static/images/bigImg/topbg.png differ
diff --git a/static/images/userCenter/btn_shouye_nor@2x.png b/static/images/userCenter/btn_shouye_nor@2x.png
new file mode 100644
index 0000000..563d1b5
Binary files /dev/null and b/static/images/userCenter/btn_shouye_nor@2x.png differ
diff --git a/static/images/userCenter/btn_wode_cli@2x.png b/static/images/userCenter/btn_wode_cli@2x.png
new file mode 100644
index 0000000..6cafb28
Binary files /dev/null and b/static/images/userCenter/btn_wode_cli@2x.png differ
diff --git a/static/images/userCenter/btn_xueche_nor@2x.png b/static/images/userCenter/btn_xueche_nor@2x.png
new file mode 100644
index 0000000..1c39126
Binary files /dev/null and b/static/images/userCenter/btn_xueche_nor@2x.png differ
diff --git a/static/images/userCenter/home_icon_biangen@2x.png b/static/images/userCenter/home_icon_biangen@2x.png
new file mode 100644
index 0000000..18715b5
Binary files /dev/null and b/static/images/userCenter/home_icon_biangen@2x.png differ
diff --git a/static/images/userCenter/home_icon_shenqingtuixue@2x.png b/static/images/userCenter/home_icon_shenqingtuixue@2x.png
new file mode 100644
index 0000000..ecb4361
Binary files /dev/null and b/static/images/userCenter/home_icon_shenqingtuixue@2x.png differ
diff --git a/static/images/userCenter/home_icon_tgzhuanxiao@2x.png b/static/images/userCenter/home_icon_tgzhuanxiao@2x.png
new file mode 100644
index 0000000..7e44120
Binary files /dev/null and b/static/images/userCenter/home_icon_tgzhuanxiao@2x.png differ
diff --git a/static/images/userCenter/ic_chaxun@2x.png b/static/images/userCenter/ic_chaxun@2x.png
new file mode 100644
index 0000000..1f2cd07
Binary files /dev/null and b/static/images/userCenter/ic_chaxun@2x.png differ
diff --git a/static/images/userCenter/ic_dingdan@2x.png b/static/images/userCenter/ic_dingdan@2x.png
new file mode 100644
index 0000000..70e6fd5
Binary files /dev/null and b/static/images/userCenter/ic_dingdan@2x.png differ
diff --git a/static/images/userCenter/ic_erweima@2x.png b/static/images/userCenter/ic_erweima@2x.png
new file mode 100644
index 0000000..ea7df88
Binary files /dev/null and b/static/images/userCenter/ic_erweima@2x.png differ
diff --git a/static/images/userCenter/ic_hetong@2x.png b/static/images/userCenter/ic_hetong@2x.png
new file mode 100644
index 0000000..e5c7c15
Binary files /dev/null and b/static/images/userCenter/ic_hetong@2x.png differ
diff --git a/static/images/userCenter/ic_pingjia@2x.png b/static/images/userCenter/ic_pingjia@2x.png
new file mode 100644
index 0000000..c9c728b
Binary files /dev/null and b/static/images/userCenter/ic_pingjia@2x.png differ
diff --git a/static/images/userCenter/ic_shenghuo@2x.png b/static/images/userCenter/ic_shenghuo@2x.png
new file mode 100644
index 0000000..f7b39ca
Binary files /dev/null and b/static/images/userCenter/ic_shenghuo@2x.png differ
diff --git a/static/images/userCenter/ic_shoucang@2x.png b/static/images/userCenter/ic_shoucang@2x.png
new file mode 100644
index 0000000..699cd65
Binary files /dev/null and b/static/images/userCenter/ic_shoucang@2x.png differ
diff --git a/static/images/userCenter/ic_shuju@2x.png b/static/images/userCenter/ic_shuju@2x.png
new file mode 100644
index 0000000..8b847e0
Binary files /dev/null and b/static/images/userCenter/ic_shuju@2x.png differ
diff --git a/static/images/userCenter/ic_yuyue@2x.png b/static/images/userCenter/ic_yuyue@2x.png
new file mode 100644
index 0000000..f4fb2fe
Binary files /dev/null and b/static/images/userCenter/ic_yuyue@2x.png differ
diff --git a/static/images/userCenter/loginTitle.png b/static/images/userCenter/loginTitle.png
new file mode 100644
index 0000000..31e40e5
Binary files /dev/null and b/static/images/userCenter/loginTitle.png differ
diff --git a/static/images/userCenter/title_1.png b/static/images/userCenter/title_1.png
deleted file mode 100644
index 4e43a56..0000000
Binary files a/static/images/userCenter/title_1.png and /dev/null differ
diff --git a/static/images/userCenter/topbg.png b/static/images/userCenter/topbg.png
new file mode 100644
index 0000000..a6333fa
Binary files /dev/null and b/static/images/userCenter/topbg.png differ
diff --git a/static/images/登录流程切图/__MACOSX/登录流程切图/._.DS_Store b/static/images/登录流程切图/__MACOSX/登录流程切图/._.DS_Store
deleted file mode 100644
index a5b28df..0000000
Binary files a/static/images/登录流程切图/__MACOSX/登录流程切图/._.DS_Store and /dev/null differ
diff --git a/static/images/登录流程切图/__MACOSX/登录流程切图/._btn_1.png b/static/images/登录流程切图/__MACOSX/登录流程切图/._btn_1.png
deleted file mode 100644
index 9d0ad85..0000000
Binary files a/static/images/登录流程切图/__MACOSX/登录流程切图/._btn_1.png and /dev/null differ
diff --git a/static/images/登录流程切图/登录流程切图/.DS_Store b/static/images/登录流程切图/登录流程切图/.DS_Store
deleted file mode 100644
index 49f0b45..0000000
Binary files a/static/images/登录流程切图/登录流程切图/.DS_Store and /dev/null differ
diff --git a/static/images/登录流程切图/登录流程切图/bg_1.png b/static/images/登录流程切图/登录流程切图/bg_1.png
deleted file mode 100644
index 1086c92..0000000
Binary files a/static/images/登录流程切图/登录流程切图/bg_1.png and /dev/null differ
diff --git a/static/images/登录流程切图/登录流程切图/btn_1.png b/static/images/登录流程切图/登录流程切图/btn_1.png
deleted file mode 100644
index fdbfd5d..0000000
Binary files a/static/images/登录流程切图/登录流程切图/btn_1.png and /dev/null differ
diff --git a/static/images/登录流程切图/登录流程切图/btn_2.png b/static/images/登录流程切图/登录流程切图/btn_2.png
deleted file mode 100644
index d5c36ea..0000000
Binary files a/static/images/登录流程切图/登录流程切图/btn_2.png and /dev/null differ
diff --git a/static/images/登录流程切图/登录流程切图/title_1.png b/static/images/登录流程切图/登录流程切图/title_1.png
deleted file mode 100644
index 4e43a56..0000000
Binary files a/static/images/登录流程切图/登录流程切图/title_1.png and /dev/null differ
diff --git a/store/getters.js b/store/getters.js
index 5310063..df07d39 100644
--- a/store/getters.js
+++ b/store/getters.js
@@ -1,21 +1,7 @@
-// export default {
-// userInfo: state => state.user.userInfo,
-// pushMessage: state => state.push.pushMessage,
-// currentAdd: state=>{
-// };
-
export default {
+ city: state => state.user.vuex_cityInfo.city,
pushMessage: state => state.push.pushMessage,
- getCurrentAdd: function (state) {
- //返回一个函数用于接收
- return function (id) {
- let add = state.add.addList.find(item => item.id == id)
- if(add) {
- return add
- }else {
- return {}
- }
- }
- }
-};
+}
+
+
diff --git a/store/index.js b/store/index.js
index 061f5dc..50a9fb1 100644
--- a/store/index.js
+++ b/store/index.js
@@ -6,74 +6,18 @@ import getters from './getters';
Vue.use(Vuex);
+
const store = new Vuex.Store({
state: {
- currentSchool: '',
- userInfo: {},
- latLng: {},
-
- classChooseItem: {},
- pdfUrl: '',
webViewUrl: '',
- havePay: 0, //tabbar 页面是否显示报错小图标
- currentMyMsg: {},
- billPrice: 0, //开发票的id
- TrainingOrderId: '', //退款流程里的驾校id
- bankInfo: {
- realName: uni.getStorageSync('userInfo').realName,
- phoneCode: ''
- },
- chooseCoachItem: {
- coachId: ''
- }, //报名时选择的教练
- realAuthsuccee: false,
},
getters,
mutations: {
- // 选择学校
- upDateTrainingSchoolId(state, currentSchool) {
- state.currentSchool = currentSchool
- },
// webViewUrl
updateWebVeiwUrl(state, url) {
state.webViewUrl = url
},
- // 更新用户信息
- upDateUserInfo(state, userInfo) {
- state.userInfo = userInfo
- },
- updatePushMyMsg(state, item) {
- state.currentMyMsg = item
- },
- upDateBillPrice(state, billPrice) {
- state.billPrice = billPrice
- },
- upDateTrainingOrderId(state, trainingOrderId) {
- state.trainingOrderId = trainingOrderId
- },
- // tabbar 页面是否显示报错小图标
- updateHavePay(state, havePay) {
- state.havePay = havePay
- },
- // 报名时选择教练
- upDateCoachItem(state, item) {
- state.chooseCoachItem = item
- },
- // 申请退款时的银行卡信息
- upDateBankInfo(state, obj) {
- for (let k in obj) {
- if (state.bankInfo[k]) {
- state.bankInfo[k] = obj[k]
- } else {
- uni.$set(state.bankInfo, k, obj[k])
- }
- }
- },
- // 更新经纬度
- updateLatLng(state, item) {
- state.latLng = item
- },
},
diff --git a/store/modules/user.js b/store/modules/user.js
index 5af0505..40a337e 100644
--- a/store/modules/user.js
+++ b/store/modules/user.js
@@ -1,31 +1,99 @@
+import qqmapWx from '../../common/sdk/qqmap-wx-jssdk.min.js'; // 引入
-import addApi from '../../common/sdk/qqmap-wx-jssdk.min.js'; // 引入
const user = {
state: {
- addList: []
+ vuex_cityInfo: uni.getStorageSync('vuex_cityInfo') ? uni.getStorageSync('vuex_cityInfo') : {city: '杭州市'},
+ vuex_userInfo: uni.getStorageSync('vuex_userInfo') ? uni.getStorageSync('vuex_userInfo') : {},
},
mutations: {
- // 更新广告列表
- upDateAddList(state, list) {
- state.addList = list
- },
+ update_vuex_cityInfo(state, payload) {
+ state.vuex_cityInfo = payload
+ uni.setStorageSync('vuex_cityInfo', payload);
+ }
},
actions: {
- // 点击广告
- async addClick({commit, dispatch}, curAdd) {
- // await dispatch('updateStatistics')
- curAdd.clicks ++
- if(!curAdd.adBannerDO.jumpUrl) {
- return false
- }
-
- commit('updateWebVeiwUrl', curAdd.adBannerDO.jumpUrl)
- uni.navigateTo({
- url:'/pages/commeWebView/addWebView'
+ getCity({commit}) {
+ return new Promise((resolve, reject) => {
+ // #ifdef APP-PLUS||H5
+ getCityInfo(resolve, reject,commit)
+ // #endif
+ // #ifdef MP-WEIXIN
+ uni.authorize({
+ scope: 'scope.userLocation',
+ success() {
+ getCityInfo(resolve, reject,commit)
+ },
+ fail: function(res4) {
+ uni.showModal({
+ title: '提示',
+ content: '小程序想要获取您的地里位置',
+ success: function(res) {
+ if (res.confirm) {
+ uni.openSetting({
+ success(res) {
+ getCityInfo(resolve, reject,commit)
+ }
+ });
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ }
+ }
+ })
+ },
+ })
+ // #endif
})
},
}
}
- export default user
\ No newline at end of file
+export default user
+
+
+function getCityInfo(resolve, reject, commit) {
+ uni.showLoading({
+ title: '加载中...'
+ })
+ var qqmapKey = new qqmapWx({
+ key: '2BTBZ-6BQRB-ZG4UG-NOYYG-KZMH7-B4BYN'
+ })
+ uni.getLocation({
+ type: 'wgs84',
+ // type: 'gcj02',
+ success: function(res) {
+ console.log('当前位置的经度:' + res.longitude);
+ console.log('当前位置的纬度:' + res.latitude);
+ qqmapKey.reverseGeocoder({
+ location: {
+ latitude: res.latitude,
+ longitude: res.longitude
+ },
+ success(res2) {
+ // console.log('城市信息')
+ // console.log(res2.result)
+ let result = res2.result
+ let obj = {
+ latitude: res.latitude,
+ longitude: res.longitude,
+ city: result.address_component.city,
+ cityCode: result.ad_info.adcode,
+ province: result.address_component.province,
+ district: result.address_component.district
+ }
+ commit('update_vuex_cityInfo', obj)
+ resolve(obj)
+ uni.hideLoading();
+
+ },
+ fail: function(res3) {
+ reject(res3)
+ uni.hideLoading();
+ },
+ })
+ },
+ fail(e) {
+ console.log(e)
+ }
+ })
+}
\ No newline at end of file