diff --git a/App.vue b/App.vue
index a412bfb..a1e7a22 100644
--- a/App.vue
+++ b/App.vue
@@ -74,6 +74,7 @@
if (res.data.code == 200) {
uni.setStorageSync('userInfo', JSON.stringify(res.data.data));
uni.setStorageSync('phone', res.data.data.phone);
+ this.doLogin(res.data.data.username, res.data.data.phone);
} else {
uni.showToast({
title: res.data.msg,
@@ -83,6 +84,38 @@
}
})
},
+ //登录
+ doLogin(username, phone) {
+ uni.showLoading({
+ title: '登录中',
+ mask: true
+ });
+ uni.request({
+ url: this.globalData.baseUrl + '/blade-auth/getToken',
+ method: 'POST',
+ data: {
+ openId: this.globalData.openId,
+ username: username,
+ phone: phone
+ },
+ header: {
+ 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
+ },
+ success: (res) => {
+ if (res.data.code == 200) {
+ uni.setStorageSync('token', res.data.data.access_token);
+ } else {
+ uni.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ },
+ complete: () => {
+ uni.hideLoading();
+ }
+ })
+ },
//微信登陆
wxLogin() {
uni.login({
diff --git a/pages.json b/pages.json
index 094db33..e7e1a72 100644
--- a/pages.json
+++ b/pages.json
@@ -126,6 +126,22 @@
}
}
}
+ },
+ {
+ "path": "pages/pages_zhentou/contact/contact",
+ "style": {
+ "navigationBarTitleText": "售后服务",
+ "app-plus": {
+ "titleNView": {
+ // "buttons": [{
+ // "text": "\ue534",
+ // "fontSrc": "/static/uni.ttf",
+ // "fontSize": "22px",
+ // "color": "#FFFFFF"
+ // }]
+ }
+ }
+ }
}
],
// "subPackages": [{
diff --git a/pages/pages_zhentou/contact/contact.vue b/pages/pages_zhentou/contact/contact.vue
new file mode 100644
index 0000000..8573096
--- /dev/null
+++ b/pages/pages_zhentou/contact/contact.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+ 壹人壹枕
+
+
+ 扫描二维码,添加客服企业微信
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/pages_zhentou/homePage/homePage.vue b/pages/pages_zhentou/homePage/homePage.vue
index d5fa7b8..e357d60 100644
--- a/pages/pages_zhentou/homePage/homePage.vue
+++ b/pages/pages_zhentou/homePage/homePage.vue
@@ -1,7 +1,7 @@
-
+
@@ -29,7 +29,8 @@
hasUserInfo: false,
canIUseGetUserProfile: false,
phone: '',
- hasPhone: false
+ hasPhone: false,
+ bgSrc: '', //背景图片
}
},
onShow() {
@@ -46,16 +47,58 @@
this.userInfo = JSON.parse(userInfo);
this.hasUserInfo = true;
}
+ //商品信息
+ if (this.bgSrc == '') {
+ this.queryGoodsInfo();
+ }
},
methods: {
+ //商品信息
+ queryGoodsInfo() {
+ uni.request({
+ url: 'http://192.168.1.106:80/blade-system/dict-biz/get-goods-info',
+ method: 'GET',
+ success: (res) => {
+ if (JSON.stringify(res.data.data) !== '{}') {
+ this.bgSrc = res.data.data.imgPath;
+ } else {
+ this.bgSrc = '../../../static/image/bag.jpg';
+ }
+ }
+ })
+ },
// 点击定制
clickCustom() {
console.log('点击定制');
+ uni.request({
+ url: 'http://192.168.1.106:80/blade-desk/order/save', //getApp().globalData.baseUrl + '/blade-desk/order/save',
+ method: 'POST',
+ data: {
+ buyerId: this.userInfo.id,
+ buyerName: this.userInfo.username,
+ buyerPhone: this.phone
+ },
+ header: {
+ 'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
+ },
+ success: (res) => {
+ if (res.data.code == 200) {
+
+ } else if (res.data.code == 401) {
+
+ } else {
+ uni.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ }
+ })
},
// 跳转到我的页面
- turnMyPage(){
+ turnMyPage() {
uni.navigateTo({
- url:"/pages/pages_zhentou/myPage/myPage"
+ url: "/pages/pages_zhentou/myPage/myPage"
})
},
// 填写表单
@@ -77,7 +120,7 @@
console.log(res)
this.userInfo = res.userInfo;
this.hasUserInfo = true;
- uni.setStorageSync('userInfo', JSON.stringify(res.userInfo));
+ // uni.setStorageSync('userInfo', JSON.stringify(res.userInfo));
},
fail: (err) => {
console.log(err)
@@ -131,6 +174,38 @@
}
})
},
+ //登录
+ doLogin() {
+ uni.showLoading({
+ title: '登录中',
+ mask: true
+ });
+ uni.request({
+ url: getApp().globalData.baseUrl + '/blade-auth/getToken',
+ method: 'POST',
+ data: {
+ openId: getApp().globalData.openId,
+ username: this.userInfo.username,
+ phone: this.phone
+ },
+ header: {
+ 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
+ },
+ success: (res) => {
+ if (res.data.code == 200) {
+ uni.setStorageSync('token', res.data.data.access_token);
+ } else {
+ uni.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ },
+ complete: () => {
+ uni.hideLoading();
+ }
+ })
+ }
}
}
@@ -138,12 +213,13 @@