Commit 9074c4c4 authored by 小耗子's avatar 小耗子

绑卡

parent 7ec51e25
......@@ -3,12 +3,12 @@
*/
// export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wx.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
// export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名
export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss
export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析
export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
export const MALL_ID ="101656910000414";
export const COMPANY_ID ="0210010";
export const MALL_ID ="119583623123146";
export const COMPANY_ID ="625";
......@@ -54,7 +54,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx94a3f5be1ea552ec",
"appid" : "wx91fa336def077983",
"setting" : {
"urlCheck" : false,
"minified" : true
......
......@@ -4,6 +4,15 @@
"^mpShop-(.*)": "@/components/mpShop-$1/mpShop-$1.vue"
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/h5/bindPh",
"style" :
{
"navigationBarTitleText": "立即绑定",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/index/defalutScreen",
"style" :
......@@ -63,11 +72,29 @@
"enablePullDownRefresh": false
}
}
},
{
"path" : "pages/agreement/conceal",
"style" :
{
"navigationBarTitleText": "用户隐私协议",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/agreement/user",
"style" :
{
"navigationBarTitleText": "用户服务协议",
"enablePullDownRefresh": false
}
}
],
"subPackages":[],
"tabBar": {
......
This diff is collapsed.
This diff is collapsed.
<template>
<view class="bindPh">
<view class="btn">
<u-button v-if="!checked" @click="judgeAgree" type="primary" text="微信授权" color="#00c791"></u-button>
<u-button v-else open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber" type="primary" text="微信授权" color="#00c791"></u-button>
</view>
<view class="agree">
<label class="radio" @click="agreeChange"><radio value="r1" :checked="checked" style="transform:scale(0.7);" />我已阅读并同意</label> <text class="blue" @click="agreement('user')">《用户服务协议》</text><text class="blue" @click="agreement('conceal')">《用户隐私政策》</text>
</view>
</view>
</template>
<script>
import {
mapActions,
mapGetters
} from 'vuex'
import http from '@/shopro/request/index';
export default {
data() {
return {
value:1,
checked:false
}
},
methods: {
...mapActions(['getPhoneNumber']),
agreement(flag){
uni.navigateTo({
url: `/pages/agreement/${flag}`,
})
},
agreeChange(event){
this.checked = !this.checked;
console.log(this.checked)
},
// 判断协议是否勾选
judgeAgree(){
console.log(this.checked)
if(!this.checked) {
uni.showToast({
title:"请先勾选同意协议",
duration: 2000,
icon:'none'
})
return false;
}
},
// 获取手机号
async getInfoPhoneNumber(e) {
let ph = await this.getPhoneNumber(e);
http('user.editPhone', {mobile:ph}).then(res => {
if(res.code == 0) {
uni.showToast({
title: '绑定成功',
duration: 2000,
icon:'none'
});
uni.navigateTo({
url: `/pages/h5/index?appointPage=personalCenter`
})
}else{
uni.showToast({
title: res.msg,
duration: 2000,
icon:'none'
});
uni.navigateTo({
url: `/pages/h5/index?appointPage=personalCenter`
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.bindPh{
margin: 0 auto;
padding: 100rpx 0 ;
width: 90%;
margin: 0 auto;
// text-align: center;
.btn{
}
.agree{
margin-top:30rpx;
font-size: 25rpx;
.blue{
color: #4395ff;
}
}
}
</style>
......@@ -4,7 +4,8 @@
<button v-if="unregistered" @click="changeTabBar" class="btn">
马上进入
</button>
<button v-else class="btn" open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber">
<!-- open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber" -->
<button v-else class="btn" @click="getInfoPhoneNumber">
微信授权登录
</button>
</view>
......@@ -38,7 +39,7 @@
},
// 获取手机号
async getInfoPhoneNumber(e) {
let number = await this.getPhoneNumber(e);
// let number = await this.getPhoneNumber(e);
let register = await this.registerInfoFn();
if (register) { //注册成功
this.unregistered = true;
......
......@@ -43,7 +43,12 @@ export default {
url:'order/status',
auth: true,
method: "get"
}
},
editPhone:{
url:'mall/member/addPhone',
auth: true,
method: "post"
},
},
index:{
......
......@@ -144,13 +144,13 @@ const actions = {
// 注册用户
registerInfoFn({commit,state},e){
return new Promise((resolve,reject) => {
if(!state.registerInfo.mobile){
uni.showToast({
title: "手机号为空",
duration: 2000,
icon:'none'
});
}
// if(!state.registerInfo.mobile){
// uni.showToast({
// title: "手机号为空",
// duration: 2000,
// icon:'none'
// });
// }
http('user.register', state.registerInfo).then(res => {
if (res.code==0) {
resolve(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment